This is the mail archive of the 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] New deferred output pragma

With GCC4.4 and compiling the following test case we get

gcc -O2 test.c

bar (int *array, int offset, int size)
  int access (int *array, int index) __attribute__ ((far));
  access (int *array, int index)
  { return array[index + offset]; }
  for (int i = 0; i < size; i++)
    access (array, i);

test.c: In function 'bar':
test.c:3: warning: 'far' attribute directive ignored
test.c:4: error: static declaration of 'access' follows non-static
test.c:3: note: previous declaration of 'access' was here

The GCC documentation says declaring a nested function static is
which is very confusing.


-----Original Message-----
From: Paolo Bonzini [] On Behalf Of Paolo
Sent: 13 April 2010 18:14
To: Dave Edwards
Cc: Chris Lattner; David Stubbs; Basile Starynkevitch;;; sdkteam-gnu
Subject: Re: [PATCH][libcpp] New deferred output pragma

On 04/13/2010 07:06 PM, Dave Edwards wrote:
>> 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

In the middle-end, nested functions are definitely well supported (and 
relied upon by the Ada compiler).

Can you expand further on the issues you encountered?


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