This is the mail archive of the
mailing list for the GCC project.
Re: __inline__ keyword in 3.0+?
- To: Tom Leete <tleete at mountain dot net>
- Subject: Re: __inline__ keyword in 3.0+?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 11 Jan 2001 10:25:01 +0000 (GMT)
- cc: <gcc at gcc dot gnu dot org>
On Thu, 11 Jan 2001, Tom Leete wrote:
> 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__ is already documented as an alternate spelling (extend.texi,
"Alternate Keywords"). The synonyms of standard keywords are needed so
that headers can work for a wide range of options and versions - note that
in the past glibc has, for example, use __const, __signed and __volatile
for compatibility with -traditional (but now no longer supports
compilation with -traditional). It just so happens that in this case the
standard has defined different semantics for the keyword inline, and
breaking the alternate nature seems confusing. The C language has
changed; programs need to change to accommodate it, just as C++ programs
have needed to change to accommodate changes in C++. Use of "static
inline" is reasonably compatible.
Joseph S. Myers