> On Aug 4, 2015, at 12:19 PM, Ed Schouten <e...@nuxi.nl> wrote:
> 
> 2015-07-31 8:21 GMT+02:00 Bruce Evans <b...@optusnet.com.au>:
>> For gcc before 4.6,
>> the ifdef reduces to using __COUNTER__ as the second variable if
>> __COUNTER__ is supported, else nothing.  So for the undocumented
>> subset of compilers that support __COUNTER__ all cases work, and
>> for the complementary subset no cases work (the macro is null).
> 
> I was wondering: could we solve this by not using a typedef, but an
> external declaration:
> 
> extern int __whatever[expr ? 1 : -1];
> 
> I think we can safely repeat this multiple times without triggering
> any compiler errors.

There’s at least one compiler in common use that warns about

extern int fred[1];
extern int fred[1];

being a repeated declaration (despite being legal C).

Warner

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to