bison-patches
[Top][All Lists]
Advanced

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

#if versus #ifdef in bison.simple


From: Paul Eggert
Subject: #if versus #ifdef in bison.simple
Date: Mon, 3 Dec 2001 12:03:43 -0800 (PST)

> From: Akim Demaille <address@hidden>
> Date: 30 Nov 2001 12:30:21 +0100
> 
> Just one note: we try as much as possible to move to #if
> instead of #ifdef.  In particular, you should safely rely on #if
> ERROR_VERBOSE and so on.

I like that style for code that I maintain, but bison.simple needs to
follow a stricter style, as it is used by people who use a variety of
styles.  A few people like to compile with gcc -Wundef, and that will
cause `#if FOO' to generate a diagnostic if FOO is not defined.

Also, for the particular case of YYERROR_VERBOSE, the manual states
"It doesn't matter what definition you use for YYERROR_VERBOSE, just
whether you define it."  So we couldn't use `#if YYERROR_VERBOSE' even
if we didn't care about gcc -Wundef.



reply via email to

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