Re: Inline functions in C99

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Paulo J. Matos" wrote:

> timemgm.c:37: warning: C99 inline functions are not supported; using GNU89
> timemgm.c:37: warning: to disable this warning use -fgnu89-inline or
> the gnu_inline function attribute
> timemgm.c:43: warning: C99 inline functions are not supported; using GNU89
> timemgm.c:52: warning: C99 inline functions are not supported; using GNU89
> 
> What was the change between gcc version so that now I can't inline
> functions? Why is this? If I can't inline functions, won't this reduce
> the efficiency of my binary, or at least hinder my possibilities of
> optimizing it?

The warning is not saying what you think it is.  What it is telling you
is that the semantics of "inline" which that version of gcc supports do
not match the C99 semantics; they are the "gnu inline" semantics.  The
difference has to do with how "extern inline" works.  There is a summary
of the differences here:
<http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html>

Note that in gcc 4.3 this has been rectified, i.e. the changes in that
message have been made.  So in 4.3, if you enable c99 mode (instead of
the default which is gnu89 mode) you do actually get the c99 semantics
of inline, which is a change from all past versions of gcc.  That is why
the warning was added to 4.2, in anticipation of the change coming in
the next version, so that people that use inline and c99 mode will get
some indication that something might break.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux