Date: Fri, 22 Nov 1996 14:42:01 GMT From: kvhk AT ivs4 DOT barco DOT com (Koen Van Herck) Message-Id: <9611221442.AA03979@ivs4.> To: eliz AT is DOT elta DOT co DOT il Cc: A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk, DJGPP AT delorie DOT com In-Reply-To: (message from Eli Zaretskii on Fri, 22 Nov 1996 13:24:21 +0200 (IST)) Subject: Re: v2 unwanted warnings Reply-To: Koen DOT VanHerck AT barco DOT com > > On Fri, 22 Nov 1996, A.Appleyard wrote: > > > #define nu __attribute__ ((unused)) > > class point{public: double x,y;}; > > int miaow(point w nu,double z nu){} > > and every time I got this error:- > > > > t$$$.cc:3: parse error before `__attribute__' > > When using a feature, it helps to first read the docs about how it should > be used. You should say like so: > > int miaow (point nu w, double nu z) {} > > The attribute should go *before* the name, not after it. Think of the > attribute as if it were a modifier, like `volatile'. > > Note that I didn't have time to test the above, as I never used this > attribute, so I might be wrong after all. But it works for me in similar > contexts and with different attributes. > The docs say: int x __attribute__ ((aligned (16))) = 0; I tried int foo(int a, int __attribute__ ((unused)) b ) and I got: unusedpp.cc:3: warning: `unused' attribute ignored unusedpp.cc: In function `int foo(int, int)': unusedpp.cc:4: warning: unused parameter `int b' So it doesn't work like that. ---- Koen Van Herck Electronic Design Engineer E-mail: Koen DOT VanHerck AT barco DOT com BBBB AAA RRRR CCC OOO B A R C O V I S U A L S Y S T E M S B B A A R R C O O A division of Barco Projection Systems B BB A AAA R RR C OO O OO B B A A R R C O O Noordlaan 5 Tel +32 (0)56 36 85 71 BBBB A A R R CCC OOO B-8520 Kuurne Fax +32 (0)56 36 83 55