[lkml]   [2005]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [parisc-linux] [2.6 patch] parisc: "extern inline" -> "static
    > > I really don't think it makes any difference.  Such a function (returning
    > > always 0) is always going to be inlined, and the only difference between
    > > static inline and extern inline is what happens when it can't be inlined.
    > On !alpha we are defining inline to __attribute__((always_inline)) for
    > any non-ancient gcc making this a zero difference.

    It looks as if there are subtle differences between "always_inline"
    and "extern inline". From the GCC extensions document:

    Generally, functions are not inlined unless optimization is specified.
    For functions declared inline, this attribute inlines the function even
    if no optimization level was specified.

    [extern inline]
    If you specify both @code{inline} and @code{extern} in the function
    definition, then the definition is used only for inlining. In no case
    is the function compiled on its own, not even if you refer to its
    address explicitly. Such an address becomes an external reference, as
    if you had only declared the function, and had not defined it.

    The primary difference between "static inline" and "extern inline"
    is in what happens when the address of the function is referenced.
    With "extern inline", you need a unique library function to resolve
    external references. With "static inline", you may end up with
    multiple copies of a function if its address is taken.

    > The bigger issue is that "extern inline" generates a warning with
    > -Wmissing-prototypes and I'm currently working on getting the kernel
    > cleaned up for adding this to the CFLAGS since it will help us to avoid
    > a nasty class of runtime errors.

    The prototypes could be added.

    J. David Anglin
    National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-10-30 17:47    [W:0.022 / U:0.068 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site