This is the mail archive of the gcc@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]

Re: __inline__ keyword in 3.0+?


"Joseph S. Myers" wrote:
> 
> On Tue, 9 Jan 2001, Tom Leete wrote:
> >
> > Keeping gcc2.x behavior for '__inline__' while observing standard for
> > 'inline' would allow compilation of mixed C99 and old gcc-specific sources.
> > Denying that forces disuse of C99 in many situations. The fixinclude could
> > then be as simple as a pipe through:
> 
> Would keeping the old inline semantics (for both inline and __inline__)
> under -std=gnu89, while using the new semantics (for both inline and
> __inline__) under -std=gnu99 (which will become the default at some point
> once C99 support is ready), suffice?  I feel that would be less confusing
> than making different spelling of a keyword mean different things.

<aside>
Re: -std (was Re: v3 link...) (on this list)
ISO-IEC-14882-1998:27.8.2 Table 94 lists vprintf as declared in <cstdio>.
Reference is made to: ISO C subclause 7.9, Amendment 1 subclause 4.6.2.
A nod of thanks to you and the other contributors to that thread. It was a
great help in preparing this.
</aside>

I think it's the meaning of -std=gnu99 that we're discussing. The older
strict options must reject both forms. The -std=c99 must accept 'inline'
with c99 syntax, and reject __inline__. Obviously, -std=gnu89 should
continue as it does.

I don't see __inline__ as just an alternate spelling. If 'inline' is a
keyword defined by standard, why does it need a synonym? Inlined definitions
are most commonly used in headers, and library headers should work for the
widest possible range of options and versions. Retention of current behavior
for __inline__ (as a distinct keyword) would make it much easier to use the
same headers for both new and old code, as well as with g++.

__inline__ has been useful for headers to be included by both gcc and g++.
The form '__X__' is specifically reserved to implementations in C++.

So, the question becomes: Is __inline__ under std=gnu99 to be the original
gnu extension, or a brand new one that breaks things -- including g++-3.x?

It's too bad the C99 committee devised an inline which conflicts with both
gcc and iso C++.

Regards,
Tom Leete

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