This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH][libcpp] New deferred output pragma
> Adding a generally useful feature like attributes-on-nested-functions
seems a lot more interesting than adding a special preprocessor
extension like this.
That may well be the case, but the manner in which gcc barfed when
trying to use attributes on nested functions led us to believe that
their implementation isn't necessarily robust or well exercised anyway.
Thus we chose the approach of making a cpp enhancement, which could also
be used for various other non-C function related auto-code generation
issues.
-----Original Message-----
From: Chris Lattner [mailto:clattner@apple.com]
Sent: 13 April 2010 17:58
To: Dave Edwards
Cc: Paolo Bonzini; David Stubbs; Basile Starynkevitch;
tromey@redhat.com; gcc-patches@gcc.gnu.org; sdkteam-gnu
Subject: Re: [PATCH][libcpp] New deferred output pragma
On Apr 13, 2010, at 9:42 AM, Dave Edwards wrote:
>> Why can't you use a nested function and __COUNTER__?
>
> We can't use nested functions as we need to apply special attributes
to
> the generated function to ensure it appears in a different memory
> segment.
> This isn't possible with nested functions - they don't appear to
accept
> attributes.
Adding a generally useful feature like attributes-on-nested-functions
seems a lot more interesting than adding a special preprocessor
extension like this.
-Chris