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

2013-10-05 Thread Paul D. Smith
Follow-up Comment #12, bug #27609 (project make): It's hard to diagnose problems based on general descriptions. Please provide specific examples of what you did and what the result was. However, it's definitely true that if you're relying on some of the built-in rules then turning them all off w

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

2013-10-05 Thread Kaz Kylheku
Follow-up Comment #11, bug #27609 (project make): I tried .SUFFIXES: but now make tried to build the program even though lex.yy.o is a prerequisite, and is missing, without any complaints. This is, of course, because I have a rule which gives a dependency from lex.yy.o to lex.yy.c, but which has n

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

2013-10-05 Thread Paul D. Smith
Follow-up Comment #10, bug #27609 (project make): Yes, both .y.c and .l.c suffix rules are required by the POSIX standard. However, they've been present in GNU make for over 20 years, since before POSIX standardized make, so while POSIX requirements are one reason to keep them, their existence ca

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

2013-10-05 Thread Kaz Kylheku
Follow-up Comment #9, bug #27609 (project make): What if these dangerous implicit rules made a rotating backup of their victim? What is the downside? mv foo.c.keep.1 foo.c.keep.2 mv foo.c foo.c.keep.1 mv y.tab.c foo.c ___ Repl

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

2013-10-05 Thread Kaz Kylheku
Follow-up Comment #8, bug #27609 (project make): I was just burned by this again! I have a small project with "hc.l" lexer, and a "hc.c" source file. It's been working fine. My Makefile was generating lex.yy.c from hc.l, compiling hc.c to hc.o, and lex.yy.c to lex.yy.o, and linking everything.

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

2013-09-22 Thread Paul D. Smith
Update of bug #27609 (project make): Item Group: Bug => Enhancement ___ Reply to this item at: ___ Messag

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

2009-10-13 Thread Kaz Kylheku
Follow-up Comment #7, bug #27609 (project make): Also, another consideration is that the prerequisite .y is involved in an explicit rule. If an implicit rule matches some file as a prerequisite, but that file is already used as a prerequisite in some rule, then those rules are competing. Maybe

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

2009-10-13 Thread Kaz Kylheku
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 w

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

2009-10-05 Thread Paul D. Smith
Follow-up Comment #5, bug #27609 (project make): First let me point out that the behavior you're concerned about is actually required by the POSIX standard for make; the standard requires this as a built in rule to all conforming implementations: .y.c: $(YACC) $(YFLAGS) $< mv y.tab.c $@

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

2009-10-05 Thread Kaz Kylheku
Follow-up Comment #4, bug #27609 (project make): By the way, this is quite bad. The behavior happens even if I have an explicit rule like this: foo.o: foo.c If there is a foo.y, foo.c is clobbered, even though foo.c exists. This is so retarded. The search for the prerequisite of foo.o must

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

2009-10-05 Thread Kaz Kylheku
Follow-up Comment #3, bug #27609 (project make): Re: what can be done about it. Enough silly venting. How about the question of what can be done about it? I have an idea. How about a check to see whether the .c file to be clobbered is actually a yacc-generated file? If the file already exists,

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

2009-10-05 Thread Kaz Kylheku
Follow-up Comment #2, bug #27609 (project make): If I have two different yacc files that generate different parsers in the same directory, then I'm going to be aware of that situation and resolve it. If I don't resolve it, then they will both clobber y.tab.c, which is my fault. I'm bitten by my o

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

2009-10-05 Thread Paul D. Smith
Follow-up Comment #1, bug #27609 (project make): This is how the default rule for building YACC files in GNU make has always been, for 20-odd years. From the GNU make manual section "Catalog of Rules": Yacc for C programs n.c is made automatically from n.y by running Yacc with the command

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

2009-10-05 Thread Kaz Kylheku
URL: Summary: Stupid inference rule for yacc files can clobber C sources! Project: make Submitted by: kkylheku Submitted on: Mon 05 Oct 2009 12:36:09 PM PDT Severity: 3 - Normal