Mail Archives: djgpp/1996/11/24/15:02:38
A.Appleyard wrote:
> When v2 compiled this just now:-
>
> #define nu __attribute__ ((unused))
> class point{public: double x,y;};
> int miaow(point nu w,double nu z){}
> main(){}
>
> I got this:-
>
> C:\AMNEW>gcc t$$$.cc -Wall
> t$$$.cc:3: warning: `unused' attribute ignored
> t$$$.cc:3: warning: `unused' attribute ignored
> t$$$.cc: In function `int miaow(class point, double)':
> t$$$.cc:3: warning: unused parameter `class point w'
> t$$$.cc:3: warning: unused parameter `double z'
> t$$$.cc:3: warning: control reaches end of non-void function `miaow(point, doubl
> e)'
Since your using C++, just drop the names of any unused parameters (this
is standard c++).
ie
class point{public: double x,y;};
int miaow(point, double){}
main(){}
The __attribute__((unused)) is for C bacause the language doesn't allow
unnamed paramters.
Bill
--
Leave others their otherness.
- Raw text -