On 10/03/2010 03:09 PM, Paul Hilfinger wrote:

> Replacing a definition from Flex:
> 
>   #define gram_wrap(n) 1
> 
> which is subsequently invoked in the Flex skeleton with 
> 
>    if ( gram_wrap( ) )
> 
> I can't for the life of me see anything wrong with the original (Flex's) 
> definition of gram_wrap or with its use.  It certainly works on my
> version of gcc (3.4.4 on Solaris).  What gives?

It's not portable.  The C Standard says that a macro argument
cannot be empty.  In this case the parameter n would be bound
to an empty argument.  Most compilers accept this, but some do not
(otherwise I'd never have discovered that portability bug).

Reply via email to