[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with groff's pic.y grammar
From: |
Werner LEMBERG |
Subject: |
Re: problem with groff's pic.y grammar |
Date: |
Fri, 18 Apr 2003 14:41:20 +0200 (CEST) |
> I installed this fix. [...]
Hmm, I took the sources of bison-1.875 and applied your patch, but now
I get the following compilation error:
y.tab.c: In function `int yyparse()':
y.tab.c:4156: parse error before `goto'
The relevant code snippet:
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
/* Suppress GCC warning that yyerrlab1 is unused when no action
invokes YYERROR. */
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
__attribute__ ((__unused__))
#endif
goto yyerrlab2;
I'm using g++ 2.95.3 -- gcc.info writes about the `unused' attribute:
`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++.
It seems that you have to do this:
#if defined (__GNUC_MINOR__) \
&& 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \
&& !defined (__cplusplus)
__attribute__ ((__unused__))
#endif
Werner