delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/01/18:48:09

From: "T.E.Dickey" <dickey AT clark DOT net>
Subject: Re: __attribute__((unused)), gcc get's confused...?
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990727094614 DOT 5354I-100000 AT is> <37A3AC5B DOT 59219A88 AT cartsys DOT com>
Organization: Clark Internet Services, Inc., Ellicott City, MD USA
User-Agent: tin/pre-1.4-19990624 ("Dawnrazor") (UNIX) (SunOS/5.6 (sun4u))
Lines: 18
Message-ID: <xSWo3.456$hC5.23642@iad-read.news.verio.net>
Date: Sun, 01 Aug 1999 12:14:21 GMT
NNTP-Posting-Host: 168.143.0.8
X-Complaints-To: abuse AT verio DOT net
X-Trace: iad-read.news.verio.net 933509661 168.143.0.8 (Sun, 01 Aug 1999 12:14:21 GMT)
NNTP-Posting-Date: Sun, 01 Aug 1999 12:14:21 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Nate Eldredge <nate AT cartsys DOT com> wrote:

> 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;
>    ...
> }

It works for gcc (but what would other compilers do if it happened to be
a function pointer?)

-- 
Thomas E. Dickey
dickey AT clark DOT net
http://www.clark.net/pub/dickey

- Raw text -


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