This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Handling of extern inline in c99 mode
- From: Hallvard B Furuseth <h dot b dot furuseth at usit dot uio dot no>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 10 Nov 2006 23:32:48 +0100
- Subject: Re: Handling of extern inline in c99 mode
- References: <2F4A331E-BB1F-4E0A-98E5-DF337E926B79@apple.com> <1162359635.19236.1.camel@celery.andrew.com> <m34ptj5f4g.fsf_-_@dhcp-172-18-118-195.corp.google.com>
I'm not subscribed to this list, I just noticed this discussion
while browsing around... Don't know if the list accept
non-subscriber messages either, but let's see:
Ian Lance Taylor wrote:
> codesearch.google.com finds about 6000 uses of "extern line" in
> code written in C, but the search
> inline -static -extern -# lang:c file:\.c$
> finds only 100 occurrences (...)
Because you don't search for "inline" declarations with no "static" nor
"extern", but files with "inline" which contain no "static" nor "extern"
_anywhere_ in the file, if I understand codesearch correctly.
One wish for whatever happens with "inline":
Please document what #if tests one should put in a portable (non-GNU:-)
program in order to (a) get the intended operation of gcc 'inline' and
(b) not drown the program's users in warning messages.
In this regard, 'inline' which behaves differently with -std=c99 and
gnu99 will make for a more complicated test. So will introducing the
change - even just the default warning - in many branches at once.
A new -Wno-inline-warning option would not help either, since older
gcc versions will complain about the new option.
Maybe you should #define __gcc_gnu_inline__ and __gcc_c99_inline__
as the proper attribute/keyword so that a program can #ifdef on them.
I wonder what "-pedantic" should do about "inline"? I've seen many
people use "-pedantic" without "-std"/"-ansi", because on many
systems the latter break some header files.
--
Regards,
Hallvard