This is the mail archive of the gcc-bugs@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: g++: __attribute__ ((unused)) in function definition


This has been fixed on the mainline of the cvs version of gcc (3.1);
I don't know if it will or was back ported to gcc 3.0 for gcc 3.0.4.

Thanks,
Andrew Pinski
On Wednesday, January 23, 2002, at 08:52 , Lane, Roy wrote:

> Hi,
>
> This looks like a bug to me (sorry if it's already a known problem):
>
>> cat -> xx.c
> int main(int argc __attribute__ ((unused))) { int x; x = x + 1; return
> (1); }
>> gcc -c -Wall -W xx.c
>> mv xx.c xx.cxx
>> g++ -c -Wall -W xx.cxx
> xx.cxx:1: parse error before `__attribute__'
> xx.cxx: In function `int main(...)':
> xx.cxx:1: ISO C++ forbids declaration of `x' with no type
> xx.cxx:1: parse error before `return'
>
> ^^^ looks like g++ isn't recognizing __attribute__ in function
> parameter.
>      gcc handles this correctly (as shown above)
>
> environment:
>
>> gcc -v
>
> Reading specs from
> /cadsrv/proj14/gcc/opt/TWWfsw/gcc302/bin/../lib/gcc-lib/alpha-dec-osf4.0
> d/3.0.2/specs
> Configured with: ../configure --enable-nls --with-included-gettext
> --enable-shared --enable-libgcj --enable-threads
> --prefix=/opt/TWWfsw/gcc302 --with-local-prefix=/opt/TWWfsw/gcc302
> Thread model: single
> gcc version 3.0.2
>
>> g++ -v
>
> Reading specs from
> /cadsrv/proj14/gcc/opt/TWWfsw/gcc302/bin/../lib/gcc-lib/alpha-dec-osf4.0
> d/3.0.2/specs
> Configured with: ../configure --enable-nls --with-included-gettext
> --enable-shared --enable-libgcj --enable-threads
> --prefix=/opt/TWWfsw/gcc302 --with-local-prefix=/opt/TWWfsw/gcc302
> Thread model: single
> gcc version 3.0.2
>
>> uname -a
>
> OSF1 ... V4.0 1229 alpha
>
> thanks,
>
> Roy
>
>


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