Date: Wed, 14 Dec 2011 14:26:01 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Stefan Farfeleder <stefanf@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten <ed@freebsd.org> Subject: Re: svn commit: r228471 - in head/sys: boot/arm/at91/libat91 dev/cm dev/de dev/fdc dev/pccard dev/spibus dev/xen/netback pc98/cbus Message-ID: <20111214140737.J1950@besplex.bde.org> In-Reply-To: <20111213144539.GB1587@mole.fafoe.narf.at> References: <201112131406.pBDE61bc053693@svn.freebsd.org> <20111213144539.GB1587@mole.fafoe.narf.at>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111214140737.J1950>