* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
@ 2003-07-18 23:30 ` dhazeghi at yahoo dot com
2003-07-20 23:57 ` bje at wasabisystems dot com
` (12 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-07-18 23:30 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |documentation
Last reconfirmed|0000-00-00 00:00:00 |2003-07-18 23:30:56
date| |
------- Additional Comments From dhazeghi at yahoo dot com 2003-07-18 23:30 -------
Ben, this has been assigned to you for a few months, any progress?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
2003-07-18 23:30 ` [Bug c++/5026] __attribute__ ((unused) seems misdocumented dhazeghi at yahoo dot com
@ 2003-07-20 23:57 ` bje at wasabisystems dot com
2003-08-03 15:42 ` pinskia at physics dot uc dot edu
` (11 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: bje at wasabisystems dot com @ 2003-07-20 23:57 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
------- Additional Comments From bje at wasabisystems dot com 2003-07-20 23:57 -------
Subject: Re: __attribute__ ((unused) seems misdocumented
"dhazeghi at yahoo dot com" <gcc-bugzilla@gcc.gnu.org> writes:
> Ben, this has been assigned to you for a few months, any progress?
I guess I picked it off the stack to work on it, but never got
started. Feel free to reassign it to anyone interested.
Ben
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
2003-07-18 23:30 ` [Bug c++/5026] __attribute__ ((unused) seems misdocumented dhazeghi at yahoo dot com
2003-07-20 23:57 ` bje at wasabisystems dot com
@ 2003-08-03 15:42 ` pinskia at physics dot uc dot edu
2003-08-03 15:47 ` neroden at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-03 15:42 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|bje at gcc dot gnu dot org |unassigned at gcc dot gnu
| |dot org
Status|ASSIGNED |NEW
------- Additional Comments From pinskia at physics dot uc dot edu 2003-08-03 15:42 -------
Reassign this one to no one.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (2 preceding siblings ...)
2003-08-03 15:42 ` pinskia at physics dot uc dot edu
@ 2003-08-03 15:47 ` neroden at gcc dot gnu dot org
2003-11-05 7:20 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: neroden at gcc dot gnu dot org @ 2003-08-03 15:47 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
------- Additional Comments From neroden at gcc dot gnu dot org 2003-08-03 15:47 -------
The last sentence is supposed to mean "attribute unused is not supported by
G++", plus some bogus rationale. Which is false anyway, I think.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (3 preceding siblings ...)
2003-08-03 15:47 ` neroden at gcc dot gnu dot org
@ 2003-11-05 7:20 ` pinskia at gcc dot gnu dot org
2003-11-05 14:28 ` bh at techhouse dot brown dot edu
` (8 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-05 7:20 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2003-07-18 23:30:56 |2003-11-05 07:20:44
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-05 07:20 -------
I think the last sentence means that c++ supports that definition of agruments can be
unamed, other than that the unused is not misdocumented.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (4 preceding siblings ...)
2003-11-05 7:20 ` pinskia at gcc dot gnu dot org
@ 2003-11-05 14:28 ` bh at techhouse dot brown dot edu
2004-01-31 20:29 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: bh at techhouse dot brown dot edu @ 2003-11-05 14:28 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
------- Additional Comments From bh at techhouse dot brown dot edu 2003-11-05 14:28 -------
Given that, how is the following wording:
@cindex @code{unused} attribute.
@item unused
This attribute suppresses the warning about a variable or function that is
not being used anywhere in its scope.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (5 preceding siblings ...)
2003-11-05 14:28 ` bh at techhouse dot brown dot edu
@ 2004-01-31 20:29 ` pinskia at gcc dot gnu dot org
2004-02-24 13:37 ` msp at nortelnetworks dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-31 20:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-31 20:29 -------
Actually now with 3.4.0 the part about C++ is wrong because now you can use the attribute in
C++. The problem is that the attribute can be put on variables also not just functions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (6 preceding siblings ...)
2004-01-31 20:29 ` pinskia at gcc dot gnu dot org
@ 2004-02-24 13:37 ` msp at nortelnetworks dot com
2004-02-24 13:41 ` msp at nortelnetworks dot com
` (5 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: msp at nortelnetworks dot com @ 2004-02-24 13:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From msp at nortelnetworks dot com 2004-02-24 13:37 -------
(In reply to comment #11)
> Actually now with 3.4.0 the part about C++ is wrong because now you can use
the attribute in
> C++. The problem is that the attribute can be put on variables also not just
functions.
Actually for C the attribute can also be applied to labels! BUT not for C++.
The following code (based on the default output from bison 1.875), will compile
in C mode, but not in C++ mode:-
void fred()
{
int x;
yyerrlab1:
__attribute__ ((__unused__))
1 x = 42;
}
The intention is to tell the compiler that yyerrlab1: may be unused, but in C++
mode you get the following error:-
p.cc: In function `void fred()':
p.cc:8: error: ISO C++ forbids declaration of `x' with no type
p.cc:8: error: redeclaration of `int x'
p.cc:3: error: `int x' previously declared here
p.cc:8: error: declaration of `int x'
p.cc:3: error: conflicts with previous declaration `int x'
It also allows its use And even more cunningly it can (or should be) possible to
attach it to labels.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (7 preceding siblings ...)
2004-02-24 13:37 ` msp at nortelnetworks dot com
@ 2004-02-24 13:41 ` msp at nortelnetworks dot com
2004-02-24 14:21 ` bangerth at dealii dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: msp at nortelnetworks dot com @ 2004-02-24 13:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From msp at nortelnetworks dot com 2004-02-24 13:41 -------
(In reply to comment #12)
> (In reply to comment #11)
Sorry, my example got mangled when I copied it in....
void fred()
{
int x;
yyerrlab1:
__attribute__ ((__unused__))
x = 42;
}
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |msp at nortelnetworks dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (8 preceding siblings ...)
2004-02-24 13:41 ` msp at nortelnetworks dot com
@ 2004-02-24 14:21 ` bangerth at dealii dot org
2004-02-24 14:35 ` msp at nortelnetworks dot com
` (3 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: bangerth at dealii dot org @ 2004-02-24 14:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-02-24 14:21 -------
The reason why it is not allowed in C++ on labels has been stated
several times: in C++, a variable declaration can follow a label,
so the attribute that you want to attach to the label really goes
to the next statement; gcc expects it to be a declaration, and
complains if it can't find one.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (9 preceding siblings ...)
2004-02-24 14:21 ` bangerth at dealii dot org
@ 2004-02-24 14:35 ` msp at nortelnetworks dot com
2004-02-24 14:52 ` bangerth at dealii dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: msp at nortelnetworks dot com @ 2004-02-24 14:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From msp at nortelnetworks dot com 2004-02-24 14:35 -------
Subject: Re: __attribute__ ((unused) seems misdocumented
Does that mean that there is no alternative way of tell gcc, in c++ mode,
that the label might not be used?
If so, I will raise a bug/enhancement request against bison suggesting
they change their usage to be #ifndef __cplusplus or something.
Cheers
Mark
On Tue, 24 Feb 2004, bangerth at dealii dot org wrote:
>
> ------- Additional Comments From bangerth at dealii dot org 2004-02-24 14:21 -------
> The reason why it is not allowed in C++ on labels has been stated
> several times: in C++, a variable declaration can follow a label,
> so the attribute that you want to attach to the label really goes
> to the next statement; gcc expects it to be a declaration, and
> complains if it can't find one.
>
> W.
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (10 preceding siblings ...)
2004-02-24 14:35 ` msp at nortelnetworks dot com
@ 2004-02-24 14:52 ` bangerth at dealii dot org
2004-02-24 18:46 ` giovannibajo at libero dot it
2004-02-24 19:09 ` bangerth at dealii dot org
13 siblings, 0 replies; 17+ messages in thread
From: bangerth at dealii dot org @ 2004-02-24 14:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-02-24 14:52 -------
There indeed doesn't seem to be a way.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (11 preceding siblings ...)
2004-02-24 14:52 ` bangerth at dealii dot org
@ 2004-02-24 18:46 ` giovannibajo at libero dot it
2004-02-24 19:09 ` bangerth at dealii dot org
13 siblings, 0 replies; 17+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-24 18:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-02-24 18:46 -------
Isn't this supposed to work:
mylabel __attribute__((unused)):
Does it work? Maybe it should.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/5026] __attribute__ ((unused) seems misdocumented
[not found] <20011205204601.5026.bh@techhouse.brown.edu>
` (12 preceding siblings ...)
2004-02-24 18:46 ` giovannibajo at libero dot it
@ 2004-02-24 19:09 ` bangerth at dealii dot org
13 siblings, 0 replies; 17+ messages in thread
From: bangerth at dealii dot org @ 2004-02-24 19:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-02-24 19:09 -------
I think it would be sensible if it would. But I checked this morning,
and it doesn't.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5026
^ permalink raw reply [flat|nested] 17+ messages in thread