On Mon, Jun 18, 2012 at 1:12 PM, Joseph S. Myers <jos...@codesourcery.com> wrote: > On Mon, 18 Jun 2012, Steven Bosscher wrote: > >> For targets that do not define NO_IMPLICIT_EXTERN_C, GCC assumes that >> included system headers are implicitly wrapped in 'extern "C" {...}'. >> I could not find where this target macro was introduced, but it is >> very old (it is already mentioned in FSFChangeLog.10 for a change in >> 1995). AFAICT, today all supported targets have C++-compatible headers > > May have been introduced by: > > Fri Nov 5 05:48:04 1993 Richard Stallman (r...@mole.gnu.ai.mit.edu) > > * cccp.c (main): Handle NO_IMPLICIT_EXTERN_C. > >> (according to one comment, even hpux8 had C++-compatible system >> headers :-), so NO_IMPLICIT_EXTERN_C shouldn't be necessary anymore. > > It was previously said that AIX headers needed it > <http://gcc.gnu.org/ml/gcc/2005-05/msg00381.html>. That of course was AIX > headers as of 2005; I don't know whether seven years later any version of > AIX supported by GCC trunk still needs this.
AFAICT, the oldest supported version is AIX 4.3, from 1997. Given that HP-UX 8 already had C++ compatible headers in 1991, one would hope that AIX 4.3 had its headers fixed also, several years after HP-UX 8. >> The only target that explicitly undefines NO_IMPLICIT_EXTERN_C is >> sparc64-openbsd, and I find it hard to believe that the system headers >> on openbsd are not also already C++-compatible. Marc, could you have a >> look at this, please? > > What targets (such as AIX?) did not explicitly undefine it, but did not > get a definition from any header they used either? It's quite likely some > such targets *should* have had NO_IMPLICIT_EXTERN_C defined, but not > necessarily all of them. The following OSs all have NO_IMPLICIT_EXTERN_C defined: darwin.h:#define NO_IMPLICIT_EXTERN_C freebsd.h:#define NO_IMPLICIT_EXTERN_C 1 gnu-user.h:#define NO_IMPLICIT_EXTERN_C (covers all glibc and glibc-derived targets). lynx.h:# define NO_IMPLICIT_EXTERN_C netbsd.h:#define NO_IMPLICIT_EXTERN_C 1 rtems.h:#define NO_IMPLICIT_EXTERN_C sol2.h:#define NO_IMPLICIT_EXTERN_C vx-common.h:#define NO_IMPLICIT_EXTERN_C So all the major OSs are covered. I'm not sure how Bionic is covered, though. Since your list (http://gcc.gnu.org/ml/gcc/2005-05/msg00377.html) the following things have changed: The following targets have been fixed (i.e. now do define NO_IMPLICIT_EXTERN_C): arm-wrs-vxworks i[34567]86-*-darwin* i[4567]86-wrs-vxworks m68k-*-uclinux* mipsisa32-*-elf* (via config/mips/elf.h) mipsisa32el-*-elf* mipsisa32r2-*-elf* mipsisa32r2el-*-elf* mipsisa64-*-elf* mipsisa64el-*-elf* mipsisa64sr71k-*-elf* mipsisa64sb1-*-elf* mipsisa64sb1el-*-elf* mips-*-elf* mipsel-*-elf* mips64-*-elf* mips64el-*-elf* mips64vr-*-elf* mips64vrel-*-elf* mips64orion-*-elf* mips64orionel-*-elf* mips-wrs-vxworks mips-wrs-windiss mipstx39-*-elf* mipstx39el-*-elf* powerpc-*-darwin* v850e1-*-* (via config/v850/v850.h) v850e-*-* v850-*-* The following have been removed: arc-*-elf* arm-*-coff* armel-*-coff* arm-semi-aof armel-semi-aof arm*-*-ecos-elf arm*-*-elf ep9312-*-elf (this is a --with-arch for arm*-*-*) arm*-wince-pe* arm-*-pe* arm*-*-kaos* c4x-* (other than c4x-*-rtems*) tic4x-* (other than tic4x-*-rtems*) hppa1.1-*-osf* hppa1.1-*-bsd* i[34567]86-sequent-ptx4* i[34567]86-sequent-sysv4* i[34567]86-*-aout* i[34567]86-*-coff* i[3456x]86-*-netware* i[34567]86-*-sysv5* i[34567]86-*-sysv4* i[34567]86-*-uwin* i[34567]86-*-kaos* i860-*-sysv4* ip2k-*-elf m68hc11-*-* m6811-*-* m68hc12-*-* m6812-*-* m68k-*-aout* m68k-*-coff* m68020-*-elf* mcore-*-pe* mn10300-*-* pdp11-*-bsd powerpc-*-beos* sparc-*-openbsd* (apparently only sparc64-openbsd is still supported) sparc-*-sysv4* strongarm-*-elf* strongarm-*-pe strongarm-*-kaos* vax-*-bsd* vax-*-sysv* vax-*-ultrix* xscale-*-elf xscale-*-coff The following targets do not define NO_IMPLICIT_EXTERN_C (mostly openbsd, aix, and generic ELF targets): arm*-*-eabi* arm*-*-symbianelf* avr-*-* (other than avr-*-rtems*) bfin*-elf* bfin*-* fr30-*-elf frv-*-elf h8300-*-* (other than h8300-*-rtems*) i[34567]86-*-elf* ia64*-*-elf* iq2000*-*-elf* m32r-*-elf* m32rle-*-elf* m68k-*-elf* mcore-*-elf pdp11-*-* sh*-*-* (other than sh*-*-linux*, sh*-*-netbsd*, sh-wrs-vxworks, and sh*-*-rtems*) rs6000-ibm-aix4.[12]* powerpc-ibm-aix4.[12]* rs6000-ibm-aix4.[3456789]* powerpc-ibm-aix4.[3456789]* rs6000-ibm-aix5.1.* powerpc-ibm-aix5.1.* rs6000-ibm-aix[56789].* powerpc-ibm-aix[56789].* i[34567]86-*-openbsd2.* i[34567]86-*openbsd3.[0123] i[34567]86-*-openbsd* m68k*-*-openbsd* mips*-*-openbsd* sparc64-*-openbsd* (deliberate #undef) vax-*-openbsd* Ciao! Steven