From: Paul Eggert Date: Thu, 4 Sep 2025 20:42:23 +0000 (-0700) Subject: extern-inline: mention likely C2y change X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d1473532316e53b7f835ea99c15f4df408587a;p=thirdparty%2Fgnulib.git extern-inline: mention likely C2y change --- diff --git a/doc/extern-inline.texi b/doc/extern-inline.texi index 89e603ff18..c0c5142d80 100644 --- a/doc/extern-inline.texi +++ b/doc/extern-inline.texi @@ -97,6 +97,11 @@ you need different macros @code{AAA_FOO_INLINE} and @code{AAA_BAR_INLINE}. Use @code{AAA_FOO_INLINE} for the functions defined in @file{aaa-foo.c}, and use @code{AAA_BAR_INLINE} for the functions defined in @file{aaa-bar.c}. +Functions defined in this way should not refer to identifiers with +static linkage, as C99 through C23 prohibit this. +Although a future C standard will likely relax this restriction, +it is still an issue on many practical platforms. + @findex _GL_INLINE @code{_GL_INLINE} is a portable alternative to C99 plain @code{inline}. diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index 0ebcba3475..820fbda5dd 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -1,5 +1,5 @@ # extern-inline.m4 -# serial 1 +# serial 2 dnl Copyright 2012-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -43,9 +43,11 @@ AC_DEFUN([gl_EXTERN_INLINE], functions or macros in standard C headers like . For example, if isdigit is mistakenly implemented via a static inline function, a program containing an extern inline function that calls isdigit - may not work since the C standard prohibits extern inline functions - from calling static functions (ISO C 99 section 6.7.4.(3). - This bug is known to occur on: + may not work since C99 through C23 prohibit extern inline functions + from calling static functions (ISO C 23 section 6.7.5.(2)). + Although a future C standard will likely relax this restriction + , + respect it for now. This bug is known to occur on: OS X 10.8 and earlier; see: https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html