This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [SH, committed] Fix PR 61026 sh-*-* Fails to Compile on FreeBSD


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]