delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/01/11:06:33

Message-ID: <37A4629D.56658A6@unb.ca>
Date: Sun, 01 Aug 1999 11:07:09 -0400
From: Endlisnis <s257m AT unb DOT ca>
X-Mailer: Mozilla 4.51 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
Subject: Re: __attribute__((unused)), gcc get's confused...?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990727094614 DOT 5354I-100000 AT is> <37A3AC5B DOT 59219A88 AT cartsys DOT com>
Reply-To: djgpp AT delorie DOT com

Nate Eldredge wrote:

> > >  b.cc(1) Error: parse error before `__attribute__'
> > >  In function `int main(...)':
> > I don't think you said it was a C++ program in your original message
> > (if you did, I missed it and I apologize).  __attribute__ support in
> > the C++ compiler has several bugs, up to and including the current
> > pretest versions of GCC 2.95.  FWIW, your example compiles without any
> > problems as a C program.
> You can get the same effect (silencing the warning) by inserting a dummy
> statement in the function that casts the variable to void.  i.e.
> void foo(int unused) {
>    (void)unused;
> }

    Thanx, but I already found a better way to silence the warning in C++,
simply don't give the parameter a name, and g++ won't expect a usage.


--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT HotMail DOT com
          ICQ: 32959047


- Raw text -


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