Targets using implicit extern "C"

Ian Lance Taylor ian@airs.com
Tue May 10 23:08:00 GMT 2005


Joe Buck <Joe.Buck@synopsys.COM> writes:

> On Tue, May 10, 2005 at 02:26:12PM -0400, Ian Lance Taylor wrote:
> > How would people feel about adding a configure option
> > --with-implicit-extern-c?  Then we could justifiably flip the default
> > for the generic *-elf, etc., targets.  In fact in general we could
> > then take the macro out of the tm.h files and into config.gcc, which
> > is probably a more reliable place to put it anyhow.
> 
> I think that the decision should be made at configure time, by checking
> the #include headers to see if they are C++-ready.  Look for the string
> "__cplusplus" in some set of standard headers, if it is not found,
> assume that we'll need implicit extern C.  For cross-builds, we still
> have a path to the headers to be checked.

It would be hard to make that completely reliable for embedded systems
development, where the header files may or not be available in any
standard place at the time that gcc is configured.

That would be a good way to set the default for the configure option,
of course.

Ian



More information about the Gcc mailing list