bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #27609] Stupid inference rule for yacc files can clobber C sources!


From: Kaz Kylheku
Subject: [bug #27609] Stupid inference rule for yacc files can clobber C sources!
Date: Tue, 13 Oct 2009 18:11:21 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)

Follow-up Comment #6, bug #27609 (project make):

I've thought about this a little bit more. Basically, here is what may be the
real issue: the rule interferes with objects which are already entangle din
other rules.

Be it as it may that it's required by POSIX and let's take it for granted
that we want that rule because people find it useful, existing projects depend
on it, et cetera.

The problem is that if I have a makefile in which the file ``y.tab.c'' is
already involved in an explicit rule.

If the makefile has this rule:

   y.tab.c: foo.y
        $(YACC) ...

make should not be interfering with this makefile by launching a ``mv
y.tab.c. xxx'' command!

This problem would mostly go away if make was smart enough to know that
target X appears on the left hand side of a rule, then it must suppress any
hidden rules which use X as a temporary file.

Surely, it's okay not to try to conform to the POSIX rule, when the makefile
explicitly /wants/ to make a target called y.tab.c.

Remmeber, the rule which makes y.tab.c could be making that y.tab.c from any
one of several Yacc files, not necessarily the same Yacc file which the
implicit rule wants to use.

In my case, it was my custom rule which made the y.tab.c, but then the
implicit rule moved it to the target (my C source which got clobbered).
Neither the source file y.tab.c, nor the target, were appropriate to the
implicit rule.

And what about parallelized builds? What if the implicit rule applies more
than one way; will it work correctly under parallel make?  Suppose that a
foo.c is to be implicitly made from a foo.y, and a bar.c is to be impliclitly
made from a bar.y. Both actions will use y.tab.c as an intermediate file.  Are
there some hidden dependencies established which serialize the execution of
the actions?

See, this is why Stallman came up with ``posix me harder''.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27609>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]