From patchwork Fri Dec 17 09:55:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR46916/46902 X-Patchwork-Submitter: IainS X-Patchwork-Id: 75852 Message-Id: To: GCC Patches Cc: Mike Stump Date: Fri, 17 Dec 2010 09:55:39 +0000 From: IainS List-Id: The two PRs turned out to be manifestations of the same issue. Basically, gcc/system.h redefines bool => unsigned char. this causes a conflict with any ABI where bool/_Bool is defined to something different (e.g. int). (I don't think PPC/Darwin is the only case where this was done... but it might be the only modern case). anyway the "gotcha" is that all {external} system headers _must_ be included before gcc/system.h (noted in that header). OK for trunk? Iain gcc: PR gcc/46902 PR testsuite/46912 * plugin.c: Ensure system headers are included before gcc/system.h Index: gcc/plugin.c =================================================================== --- gcc/plugin.c (revision 167973) +++ gcc/plugin.c (working copy) @@ -21,16 +21,19 @@ along with GCC; see the file COPYING3. If not see APIs described in doc/plugin.texi. */ #include "config.h" -#include "system.h" /* If plugin support is not enabled, do not try to execute any code that may reference libdl. The generic code is still compiled in to avoid including too many conditional compilation paths in the rest - of the compiler. */ + of the compiler. + + We must include system headers before "system.h" or the override + for bool might be upset. */ #ifdef ENABLE_PLUGIN #include #endif +#include "system.h" #include "coretypes.h" #include "diagnostic-core.h" #include "tree.h"