This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [SH, committed] Fix PR 61026 sh-*-* Fails to Compile on FreeBSD
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Oleg Endo <oleg dot endo at t-online dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Chris Johns <chrisj at rtems dot org>, Amar Takhar <verm at darkbeer dot org>, Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Date: Wed, 7 May 2014 16:37:40 +0000
- Subject: Re: [SH, committed] Fix PR 61026 sh-*-* Fails to Compile on FreeBSD
- Authentication-results: sourceware.org; auth=none
- References: <5362A9A9 dot 9020109 at oarcorp dot com> <2960244C-8548-4B0C-B031-6358D4A73A03 at t-online dot de> <5362BA01 dot 6050503 at oarcorp dot com> <E688BBFD-0DA8-4CD2-8D0A-DF93DCF90E5F at t-online dot de> <1399105469 dot 2451 dot 31 dot camel at yam-132-YW-E178-FTW>
On Sat, 3 May 2014, Oleg Endo wrote:
> +#include <sstream>
> +#include <vector>
> +#include <algorithm>
> +
> #include "config.h"
It's never OK to include any system headers (C or C++) before "config.h".
config.h may define feature test macros such as _FILE_OFFSET_BITS that
affect system headers in various ways and are only effective if defined
before any system headers are included, and if different files in GCC are
built with different settings of such feature test macros then they may
expect incompatible choices of ABI for C library types.
(This is a general principle for any software using autoconf, at least if
it uses any of the autoconf macros that can define feature test macros -
which GCC does - not just for GCC.)
--
Joseph S. Myers
joseph@codesourcery.com