www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/22/04:31:21

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT delorie DOT com
Date: Fri, 22 Nov 1996 09:22:00 GMT
Subject: Re: v2 unwanted warnings
Message-ID: <1085207BB1@fs2.mt.umist.ac.uk>

  A.Appleyard wrote:-
>   (1) It has many functions all of type void name(val N,val T1,val T2){...}.
> (val is an 8-byte class type which I declared). These functions MUST be all
> the same type, as their addresses are used as values. But some of these
> functions don't use some of their parameters. As a result the fault output
> is stuffed out with hundreds of `warning: unused parameter' warning lines.
> How to stop these warning and still use -Wall for its other useful properties?

  kvhk AT ivs4 DOT barco DOT com (Koen Van Herck) replied:-
> Or use __attribute__ ((unused)) for the unused variables.
> e.g.
> int foo(int a, int b __attribute__ ((unused)));
> This will complain if a is unused, but not is b is unused.

I just compiled this test program with v2 with -Wall:-

#define nu __attribute__ ((unused))
class point{public: double x,y;};
int miaow(point w nu,double z nu){}
main(){}

with each of these in turn as its 3rd line:-
int miaow(point w nu,double z nu){}
int miaow(point w,double z nu){}
int miaow(point w nu,double z){}
int miaow(double z nu){}

and every time I got this error:-

t$$$.cc:3: parse error before `__attribute__'

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019