From: "T.E.Dickey" Subject: Re: __attribute__((unused)), gcc get's confused...? Newsgroups: comp.os.msdos.djgpp References: <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: 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 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