Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2007 21:21:55 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/security/audit audit.c
Message-ID:  <20070523203938.M10628@besplex.bde.org>
In-Reply-To: <200705230932.l4N9WUME017084@repoman.freebsd.org>
References:  <200705230932.l4N9WUME017084@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070523203938.M10628>