This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bison vs. const vs. AIX
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Bison vs. const vs. AIX
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 16 Nov 2000 18:54:50 -0800
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
On AIX, using `cc' to bootstrap doesn't work. The reason is that in
that `cc' supports `const', but doesn't define __STDC__. So, all of
our headers use `const', but in c-parse.c, Bison does:
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
Then, we get const-mismatches in the body of c-parse.c.
I don't see a generic way to fix this problem. I was going to
duplicate the Bison logic in system.h, but that fails if the compiler
rejects multiple definitions of the same macro, which some compilers
do. (Note that Bison is not polite enough to have wrapped its
definition in `#ifndef const'.)
Does anyone see a way to fix this problem? Otherwise, we need to
force the bootstrap compiler to be `xlc', rather than `cc', on AIX.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com