Bison vs. const vs. AIX

Mark Mitchell mark@codesourcery.com
Thu Nov 16 18:56:00 GMT 2000


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


More information about the Gcc-bugs mailing list