[PATCH][libcpp] Macros for unique named functions / identifiers

Rahul Kharche rahul@IceraSemi.com
Thu Apr 15 10:09:00 GMT 2010

It's interesting to know that the idea has been explored before,
in very much the same way.

Thanks, that was very useful!

-----Original Message-----
From: Dave Korn [mailto:dave.korn.cygwin@googlemail.com] 
Sent: 14 April 2010 16:02
To: Dave Edwards
Cc: Manuel López-Ibáñez; Paolo Bonzini; tromey@redhat.com; Rahul Kharche; GCC Patches; sdkteam-gnu
Subject: Re: [PATCH][libcpp] Macros for unique named functions / identifiers

On 14/04/2010 11:30, Dave Edwards wrote:
> Thanks for your help!
> We got confused as the source of the cpp manual is in the gcc/doc
> directory, so  assumed it would have been present in the GCC manual. Doh!
> I reckon just a reference in gcc.pdf's "3.11 Options Controlling the
> Preprocessor" to the fact there is a separate cpp manual would probably do
> the trick.
> Our problem with __LINE__ was that it wasn't unique across included files,
> but it sounds like __COUNTER__ would do indeed do the trick, and thus could
> remove the need for __CANON_BASE_FILE__ and __CANON_BASE_LINE__.

  I'm having deja vú bigtime in this thread :) I suggested the same kind of
identifier-safe filename macro a couple of years ago, just at the same time as
__COUNTER__ was being proposed, and we came to the same conclusion for the
same reason!



More information about the Gcc-patches mailing list