On Tue, 13 Dec 2011, Stefan Farfeleder wrote:

Log:
  Replace `inline static' by `static inline'.

  If I interpret the C standard correctly, the storage specifier should be
  placed before the inline keyword. While at it, replace __inline by
  inline in the files affected.

No, declaration-specifier is defined recursively - any order is allowed.
Still I think having a consistent order is a good idea.

And using inline instead of __inline breaks C90 compilers.  Unline const
and signed, inline is new in C99, and there are still usable C90 compilers
(e.g., c89, gcc -std=c89 and old(?) versions of TenDRA) which will break
if it is spelled inline.  C90 compilers should also break if it is spelled
__inline, but it is easier to annul if is spelled __inline, and
<sys/cdefs.h> already supports this.

c89 and gcc -std=c89 apparently are not C compilers (even with -pedantic),
since they accept __inline.  They don't accept inline.

The support in <sys/cdefs.h> for annuling __inline works automatically
for TenDRA-4.20040902 -Ysystem (-Ysystem makes it use the system
headers).  When __inline is attached to static, annuling it doesn't
change the semantics.  Annuling it is not so safe for extern inline,
but might work for at least individual source files.  I mainly use
TenDRA for its portability checks and better diagnostics of standards
violations.  Support for C90 in headers and no C99 code in the files
being checked is enough for this.

Bruce
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to