This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Deprecate not defining NO_IMPLICIT_EXTERN_C
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, <rth at twiddle dot net>, <gnu at amylaar dot uk>, Nick Clifton <nickc at redhat dot com>, <chertykov at gmail dot com>, <jzhang918 at gmail dot com>, Bernd Schmidt <bernds_cb1 at t-online dot de>, <hp at axis dot com>, <james dot bowman at ftdichip dot com>, Jeff Law <law at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, Jim Wilson <wilson at tuliptree dot org>, <sebastien at milkymist dot org>, <eager at eagercon dot com>, <clm at codesourcery dot com>, <green at moxielogic dot com>, <jasonwucj at gmail dot com>, <cltang at codesourcery dot com>, <tom at codesourcery dot com>, <ni1d at arrl dot net>, <kito dot cheng at gmail dot com>, <dj at redhat dot com>, David Edelsohn <dje dot gcc at gmail dot com>, <hepenner at us dot ibm dot com>, Alexandre Oliva <aoliva at redhat dot com>, <davem at redhat dot com>, <walt at tilera dot com>, <matt at 3am-software dot com>, <ebotcazou at libertysurf dot fr>, <augustine dot sterling at gmail dot com>
- Date: Wed, 21 Mar 2018 21:28:31 +0000
- Subject: Re: Deprecate not defining NO_IMPLICIT_EXTERN_C
- References: <18ff217b-e10b-008b-fb26-bb0cb018b10f@acm.org>
On Wed, 21 Mar 2018, Nathan Sidwell wrote:
> Unfortunately it's a negative-sense define, that now at least most ports
> define. Do all ports define it? It's hard to determine that, because many
> ports get it set via config/gnu-user.h or similar common file.
Bare-metal ports often fail to define it.
As far as I know, newlib headers at least do not require implicit extern
C. If there are any that are missing explicit extern C, I'd rather that
was addressed by (a) fixing them and (b) adding fixes in fixincludes if we
wish to work with older header versions.
My list from 2005 of targets not defining NO_IMPLICIT_EXTERN_C then is
<https://gcc.gnu.org/ml/gcc/2005-05/msg00377.html>.
I think this should become a target hook, where the default is
implicit_extern_c returning false and only AIX (and any other OSes
requiring it) sets the hook to return true.
> It also has the following undocumented features (when not set):
Whether these are needed would depend on the properties of headers for
OSes setting the hook to return true. Even if needed, one might consider
fixing such header issues with fixincludes as a replacement for those
features in the compiler.
--
Joseph S. Myers
joseph@codesourcery.com