bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__attribute__((__unused__)) cannot be placed after the label in C++ in g


From: Grzegorz Jablonski
Subject: __attribute__((__unused__)) cannot be placed after the label in C++ in gcc-3.3.2
Date: Sat, 14 Feb 2004 17:29:19 +0100

Due to an ambiguity in C++ regarding __attribute__((__unused__)) after the
label, it is not allowed in gcc-3.3.2 C++ compiler. Therefore, the parsers
generated by bison-1.875 cannot be compiled in C++ mode.
Below is a simple fix I have used.
Regards,
GWJ

*** data/yacc.c Sat Dec 28 09:36:02 2002
--- /home/gwj/bison-1.875-mod/data/yacc.c       Sat Feb 14 16:54:03 2004
***************
*** 1113,1119 ****

    /* Suppress GCC warning that yyerrlab1 is unused when no action
       invokes YYERROR.  */
! #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
    __attribute__ ((__unused__))
  #endif

--- 1113,1119 ----

    /* Suppress GCC warning that yyerrlab1 is unused when no action
       invokes YYERROR.  */
! #if !defined (__cplusplus) && defined (__GNUC_MINOR__) && 2093 <=
(__GNUC__ * 1000 + __GNUC_MINOR__)
    __attribute__ ((__unused__))
  #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]