delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/03/02:55:20

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 990726093100 DOT 27650E AT is> <379CDE99 DOT 3E957B4 AT unb DOT ca> <7nkach$sak AT cs DOT vu DOT nl> <XLZn3.127$2O3 DOT 4229 AT iad-read DOT news DOT verio DOT net> <7o41kh$2la AT cs DOT vu DOT nl>
Organization: Clark Internet Services, Inc., Ellicott City, MD USA
User-Agent: tin/pre-1.4-19990624 ("Dawnrazor") (UNIX) (SunOS/5.6 (sun4u))
Lines: 39
Message-ID: <Rfhp3.748$hC5.37346@iad-read.news.verio.net>
Date: Mon, 02 Aug 1999 13:43:13 GMT
NNTP-Posting-Host: 168.143.0.8
X-Complaints-To: abuse AT verio DOT net
X-Trace: iad-read.news.verio.net 933601393 168.143.0.8 (Mon, 02 Aug 1999 13:43:13 GMT)
NNTP-Posting-Date: Mon, 02 Aug 1999 13:43:13 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

mdruiter AT cs DOT vu DOT nl wrote:
> T.E.Dickey <dickey AT shell DOT clark DOT net> wrote:
>> `unused'
>>      This attribute, attached to a function, means that the function is
>>      meant to be possibly unused.  GNU CC will not produce a warning
>>      for this function.  GNU C++ does not currently support this
>>      attribute as definitions without parameters are valid in C++.

> Well, this is for *functions* where we were looking for a way to
> ignore a *parameter* of a function. I don't understand "as definitions
> without parameters are valid in C++", I think. Does that apply here?

huh (I didn't read it carefully enough, and was thinking the "definitions
without parameters" applied to the discussion).

The 'info' discussion for _variables_ is more vague:

`unused'
     This attribute, attached to a variable, means that the variable is
     meant to be possibly unused.  GNU CC will not produce a warning
     for this variable.

However - my interest in the thread - from having gotten bit by this in my
configure scripts - is that afaik g++ does not accept __attribute__((unused))
for parameters.

(And it does appear to accept it for variables).

So I'm inclined to think that the remark in 'info' should read more like

   `unused'
        This attribute, attached to a function parameter,
                                               ^^^^^^^^^
        means that the parameter is meant to be possibly unused.
                       ^^^^^^^^^
-- 
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