fix parser.h recursive inclusion
PATCH 1/1 fix parser.h recursive inclusion
This the recursive parser.h inclusion that happens occasionally when regenerating the parser files. Amazingly bison, despite its age, is not using header sandwiches to protect against this *sigh*
Slightly ugly, but fixes the problem.
Makefile.rules.in +8 -1
@@ -22,7 +22,14 @@ configure: configure.ac %.c %.h: %.y $(makedeps) @echo -e " YACC\t\t$<" - $(YACC) $(YACCFLAGS) -d -o $@ $< + $(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $< + ( \ + echo "#ifndef __$(*F)_H"; \ + echo "#define __$(*F)_H"; \ + cat $*.h.tmp; \ + echo "#endif /* __$(*F)_H */" \ + ) > $*.h + $(RM) $*.h.tmp %.c %.h: %.l $(makedeps) @echo -e " LEX\t\t$<"
Pablo Neira Ayuso
maintainerQuoted 5 lines · Patrick McHardy
This the recursive
parser.hinclusion that happens occasionally when regenerating the parser files. Amazingly bison, despite its age, is not using header sandwiches to protect against this *sigh*Slightly ugly, but fixes the problem.
Ah, much nicer than the "nested too deep" warning message :)
Quoted 20 lines
Makefile.rules.in +8
-1@@ -22,7 +22,14 @@ configure: configure.ac %.c %.h: %.y $(makedeps) @echo -e " YACC\t\t$<" - $(YACC) $(YACCFLAGS) -d -o $@ $< + $(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $< + ( \ + echo "#ifndef __$(*F)_H"; \ + echo "#define __$(*F)_H"; \ + cat $*.h.tmp; \ + echo "#endif /* __$(*F)_H */" \ + ) > $*.h + $(RM) $*.h.tmp %.c %.h: %.l $(makedeps) @echo -e " LEX\t\t$<"
Quoted 8 lines · Pablo Neira Ayuso
Quoted 5 lines · Patrick McHardy
This the recursive
parser.hinclusion that happens occasionally when regenerating the parser files. Amazingly bison, despite its age, is not using header sandwiches to protect against this *sigh*Slightly ugly, but fixes the problem.
Ah, much nicer than the "nested too deep" warning message :)
Indeed. Pushed out to master.
Quoted 25 lines
Quoted 11 lines
Makefile.rules.in +1
-1@@ -22,7 +22,14 @@ configure: configure.ac %.c %.h: %.y $(makedeps) @echo -e " YACC\t\t$<" - $(YACC) $(YACCFLAGS) -d -o $@ $< + $(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $<Makefile.rules.in configure: configure.ac · line 35
Quoted 10 lines
Makefile.rules.in +7
-0+ ( \ + echo "#ifndef __$(*F)_H"; \ + echo "#define __$(*F)_H"; \ + cat $*.h.tmp; \ + echo "#endif /* __$(*F)_H */" \ + ) > $*.h + $(RM) $*.h.tmp %.c %.h: %.l $(makedeps) @echo -e " LEX\t\t$<"--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html