cvs commit: src/sys/security/audit audit.c

Bruce Evans brde at optusnet.com.au
Thu May 24 05:02:58 UTC 2007


On Wed, 23 May 2007, Robert Watson wrote:

> rwatson     2007-05-23 09:32:30 UTC
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/security/audit   audit.c
>  Log:
>  No need to force __inline__ of currecord(), as the compiler will usefully
>  inline it when needed already, and the symbol is also required outside of
>  audit.c.  This silences a new gcc warning on the topic of using __inline__
>  instead of __inline.

Er, the warning is the same for all of (non-static) inline, __inline and
__inline__.  For compiling "__inline int foo(int x)..." with -std=c99 and
no other compiler options it is:

z.c:2: warning: C99 inline functions are not supported; using GNU89
z.c:2: warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute

The wording of this warning is confusing.  Non-static inline functions
are a gnu89 feature that no longer works by default with -std=c99.
The first line of the warning seems to be just an excessively abbreivated
way of saying "in C99, GNU89 inline functions are not supported; using
GNU89 mode to do what you mean".  The second line of the warning then
describes in a better way how to enable this gnu89 feature without
getting the warning.

With -std=c89, GNU89 inline functions are of course supported, but
"inline" in them must be spelled either __inline or __inline__ since
"inline" is in the application namespace for c89.

This problem also affects i386/pmap.c.  The non-static inlines there are
similarly dubious.  But inlining shouldn't happen automatically below -O3.

Bruce


More information about the cvs-src mailing list