[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bison-1.875: build feedback: Apple Mac OS X
From: |
Paul Eggert |
Subject: |
Re: bison-1.875: build feedback: Apple Mac OS X |
Date: |
Thu, 2 Jan 2003 10:20:43 -0800 |
> Date: Thu, 2 Jan 2003 07:29:30 -0700 (MST)
> From: "Nelson H. F. Beebe" <address@hidden>
>
> The build of bison-1.875 on Apple Mac OS X succeeded, but two members
> of the test suite failed.
> 36. headers.at:76: testing Invalid CPP guards: input/input...
> headers.at:76: bison --defines=input/input.h --output=y.tab.c input/input.y
> headers.at:76: $CC -E -I. y.tab.c
> --- /dev/null Thu Jan 2 07:13:25 2003
> +++ /local/build/bison-1.875/tests/testsuite.dir/at-stderr Thu Jan 2
> 07:13:26 2003
> @@ -0,0 +1,2 @@
> +y.tab.c:1077: syntax error, missing `;' after `)'
> +cpp-precomp: warning: errors during smart preprocessing, retrying in basic
> mode
What is "smart preprocessing"? I'm not familiar with this notion,
since I don't use MacOS X. It sounds like they have a preprocessor
that is "smarter", but which sometimes doesn't work correctly, and in
that case they fall back on a "basic mode" preprocessor which _does_
work correctly. Is this what's happening?
The y.tab.c lines in question look like this:
1073 yyerrlab1:
1074
1075 /* Suppress GCC warning that yyerrlab1 is unused when no action
1076 invokes YYERROR. */
1077 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 +
__GNUC_MINOR__)
1078 __attribute__ ((__unused__))
1079 #endif
1080
1081
1082 goto yyerrlab2;
Line 1077 doesn't contain any explicit semicolons. Perhaps it's
actually complaining about line 1078.
What are __GNUC_MINOR__ and __GNUC__ defined to in your compilation
environment?
The other test failed for the same reason.
Here's a shot in the dark. Does the following patch work around your
preprocessor bug? If so, could you please tell me the exact OS and
compiler version you're using, so that I can make the comment more
precise? Thanks.
--- bison-1.875/data/yacc.c 2002-12-28 00:36:02.000000000 -0800
+++ bison-macos/data/yacc.c 2003-01-02 10:13:49.000000000 -0800
@@ -1112,9 +1112,10 @@
yyerrlab1:
/* Suppress GCC warning that yyerrlab1 is unused when no action
- invokes YYERROR. */
+ invokes YYERROR. MacOS X's "smart preprocessor" insists on the
+ trailing semicolon here. */
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
- __attribute__ ((__unused__))
+ __attribute__ ((__unused__));
#endif
]b4_location_if([ yylerrsp = yylsp;