bug-gnulib
[Top][All Lists]
Advanced

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

_GL_INLINE issue


From: Tim Rühsen
Subject: _GL_INLINE issue
Date: Fri, 13 Apr 2018 11:52:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

You likely know it, but just in case I report it here.

We use 'static _GL_INLINE' for some static functions we want to get
inlined. This works out fine (compiles without warning) at least with
gcc5-, gcc-6, gcc-7 and gcc-8, also with several versions of clang.

On the GCC Compile farm there is gcc70 (NetBSD 5.1 with gcc 4.1.3) which
errors with 'duplicate static'. Removing the 'static' keyword cmpiles
fine there, but doesn't on newer systems (link error, unknow external
reference to those functions).


I'll remove _GL_INLINE from my code since it seems more problematic then
it helps.

That follows the advice from
https://www.gnu.org/software/gnulib/manual/html_node/extern-inline.html:
"C code ordinarily should not use inline. Typically it is better to let
the compiler figure out whether to inline, as compilers are pretty good
about optimization nowadays. In this sense, inline is like register,
another keyword that is typically no longer needed."

With Best Regards, Tim


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]