www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/22/07:16:42

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 11:57:38 GMT
Subject: Re: v2 unwanted warnings
Message-ID: <131D93180C@fs2.mt.umist.ac.uk>

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__'

  Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> replied:-
> ...  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.

  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)'

- Raw text -


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