This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


CPP has its own manual. COUNTER was introduced in GCC 4.3, which is by
now pretty old, so you are probably not looking at the CPP manual. If
you have suggestions on how to avoid this confusion in the future, let
us know.

Thanks,

Manuel.

On 14 April 2010 12:16, Dave Edwards <dave@icerasemi.com> wrote:
>
> I just searched in the gcc.pdf which is built from the version of the sources we used - its not present in that version (maybe a merge problem on our part).
>
>
>
> -----Original Message-----
> From: Manuel López-Ibáñez [mailto:lopezibanez@gmail.com]
> Sent: 14 April 2010 11:14
> To: Dave Edwards
> Cc: Paolo Bonzini; tromey@redhat.com; Rahul Kharche; GCC Patches; sdkteam-gnu
> Subject: Re: [PATCH][libcpp] Macros for unique named functions / identifiers
>
> You didn't look too well:
>
> http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros
>
> On 14 April 2010 11:58, Dave Edwards <dave@icerasemi.com> wrote:
>>
>> I couldn't find any reference to __COUNTER__ in the GCC manual so didn't
>> know it existed.
>>
>> -----Original Message-----
>> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo
>> Bonzini
>> Sent: 14 April 2010 10:45
>> To: Dave Edwards
>> Cc: tromey@redhat.com; Rahul Kharche; GCC Patches; sdkteam-gnu
>> Subject: Re: [PATCH][libcpp] Macros for unique named functions /
>> identifiers
>>
>> On 04/14/2010 11:38 AM, Dave Edwards wrote:
>>> This wouldn't work - CANON_BASE_FILE is*different* ?for each included
>>> file. With this approach we'd get the same string for each invokation
>> of
>>> the compiler, and thus we'd not get unique names.
>>
>> But you would join that with __COUNTER__, not __LINE__.
>>
>> Paolo
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]