public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11613] New: attribute unused after label causes error with g++
@ 2003-07-21 10:00 jsaw at gmx dot net
  2003-07-21 14:27 ` [Bug c++/11613] " bangerth at dealii dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jsaw at gmx dot net @ 2003-07-21 10:00 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=11613

           Summary: attribute unused after label causes error with g++
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsaw at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The attribute "unused" after a jump label is not understood
by the C++ compiler.

The following simple test program compiles fine with gcc, 
while g++ fails with error:

int main() { 
unused_label: __attribute__((unused))
return 0;
}


Compiler versions tested: 2.95.3, 3.2.3, 3.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
@ 2003-07-21 14:27 ` bangerth at dealii dot org
  2003-07-21 14:33 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-07-21 14:27 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=11613


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From bangerth at dealii dot org  2003-07-21 14:27 -------
I can confirm this. However, I did not find a place in the manual that
states that it is allowed to use an attribute on a label (in particular,
the idea of putting the attribute _after_ the colon seems exceedingly
ugly to me). Can you point me to a relevant statement in the manual?
If there is none, then this would be a bug in the C front end to
grok such a thing.

Thanks
  Wolfgang


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
  2003-07-21 14:27 ` [Bug c++/11613] " bangerth at dealii dot org
@ 2003-07-21 14:33 ` pinskia at physics dot uc dot edu
  2003-07-21 15:01 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-21 14:33 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=11613


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-21 14:33:25
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-21 14:33 -------
>From <http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html>:
An attribute specifier list may appear __after__ the __colon__ following a label, other than a case or 
default label.  The only attribute it makes sense to use after a label is unused.  This feature is 
intended for code generated by programs which contains labels that may be unused but which is 
compiled with -Wall.  It would not normally be appropriate to use in it human-written code, 
though it could be useful in cases where the code that jumps to the label is contained within an 
#ifdef conditional.

Also from that page:
Because of infelicities in the grammar for attributes, some forms described here may not be 
successfully parsed in all cases
I do not know if this should be acceptable in c++.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
  2003-07-21 14:27 ` [Bug c++/11613] " bangerth at dealii dot org
  2003-07-21 14:33 ` pinskia at physics dot uc dot edu
@ 2003-07-21 15:01 ` bangerth at dealii dot org
  2003-07-23 17:17 ` nathan at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-07-21 15:01 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=11613



------- Additional Comments From bangerth at dealii dot org  2003-07-21 15:01 -------
Thanks Andrew. My personal opinion is that the association of language lawyers
should throughly enjail the person who invented this syntax, and should bar him
from ever again designing language extensions. Oh well...

W.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
                   ` (2 preceding siblings ...)
  2003-07-21 15:01 ` bangerth at dealii dot org
@ 2003-07-23 17:17 ` nathan at gcc dot gnu dot org
  2003-07-23 17:23 ` nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-23 17:17 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=11613



------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-23 17:17 -------
label: __attribute__ ((whatever))
cannot be well formed g++, because,
this is allowed
    __attribute__ ((unused)) int i;
and so is
    label:  int i;
so what does
    label: __attribute__ ((unused)) int i;
mean?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
                   ` (3 preceding siblings ...)
  2003-07-23 17:17 ` nathan at gcc dot gnu dot org
@ 2003-07-23 17:23 ` nathan at gcc dot gnu dot org
  2003-07-25 10:54 ` nathan at gcc dot gnu dot org
  2004-02-24 17:04 ` msp at nortelnetworks dot com
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-23 17:23 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=11613


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
                   ` (4 preceding siblings ...)
  2003-07-23 17:23 ` nathan at gcc dot gnu dot org
@ 2003-07-25 10:54 ` nathan at gcc dot gnu dot org
  2004-02-24 17:04 ` msp at nortelnetworks dot com
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-25 10:54 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=11613


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-25 10:54 -------
It's a feature!
2003-07-25  Nathan Sidwell  <nathan@codesourcery.com>

	* doc/extend.texi (Function Attributes): GNU C++ does now allow
	unused parameter decls.
	(Attribute Syntax): GNU C++ does not allow label attributes to be
	after the ':'.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11613] attribute unused after label causes error with g++
  2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
                   ` (5 preceding siblings ...)
  2003-07-25 10:54 ` nathan at gcc dot gnu dot org
@ 2004-02-24 17:04 ` msp at nortelnetworks dot com
  6 siblings, 0 replies; 8+ messages in thread
From: msp at nortelnetworks dot com @ 2004-02-24 17:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From msp at nortelnetworks dot com  2004-02-24 17:04 -------
*** Bug 14273 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msp at nortelnetworks dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11613


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-24 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 10:00 [Bug c++/11613] New: attribute unused after label causes error with g++ jsaw at gmx dot net
2003-07-21 14:27 ` [Bug c++/11613] " bangerth at dealii dot org
2003-07-21 14:33 ` pinskia at physics dot uc dot edu
2003-07-21 15:01 ` bangerth at dealii dot org
2003-07-23 17:17 ` nathan at gcc dot gnu dot org
2003-07-23 17:23 ` nathan at gcc dot gnu dot org
2003-07-25 10:54 ` nathan at gcc dot gnu dot org
2004-02-24 17:04 ` msp at nortelnetworks dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).