From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nftables] fix parser.h recursive inclusion
Date: Thu, 16 Jan 2014 19:15:20 +0100 [thread overview]
Message-ID: <20140116181520.GA18874@localhost> (raw)
In-Reply-To: <20140116180426.GA12421@macbook.localnet>
On Thu, Jan 16, 2014 at 06:04:27PM +0000, Patrick McHardy wrote:
> 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.
Ah, much nicer than the "nested too deep" warning message :)
> diff --git a/Makefile.rules.in b/Makefile.rules.in
> index 25988dd..ae563a5 100644
> --- a/Makefile.rules.in
> +++ b/Makefile.rules.in
> @@ -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$<"
next prev parent reply other threads:[~2014-01-16 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 18:04 [PATCH nftables] fix parser.h recursive inclusion Patrick McHardy
2014-01-16 18:15 ` Pablo Neira Ayuso [this message]
2014-01-16 18:38 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140116181520.GA18874@localhost \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).