]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
extern-inline: mention likely C2y change
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Sep 2025 20:42:23 +0000 (13:42 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Sep 2025 20:43:59 +0000 (13:43 -0700)
doc/extern-inline.texi
m4/extern-inline.m4

index 89e603ff18bab3962d1b5d5d9cf2b1d7253a3498..c0c5142d8062bc00ee69674aed084ca8414677a4 100644 (file)
@@ -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}.
 
index 0ebcba3475782fe3513a3aaaaea664d4d6335a6d..820fbda5ddb06561cc67986bc51ae5696ed55ebf 100644 (file)
@@ -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 <ctype.h>.  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
+   <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3622.txt>,
+   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