Bruno Haible via Gnulib discussion list <bug-gnulib@gnu.org> writes:

> This patch fixes it.

After this patch I noticed some autoconf warnings when running
./bootstrap. Here is a simple way to reproduce:

    $ gnulib-tool --create-testdir --dir testdir1 stddef-h
    [...]
    configure.ac:168: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call 
detected in body
    ./lib/autoconf/lang.m4:199: AC_LANG_CONFTEST is expanded from...
    ./lib/autoconf/general.m4:2821: _AC_COMPILE_IFELSE is expanded from...
    ./lib/autoconf/general.m4:2837: AC_COMPILE_IFELSE is expanded from...
    lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from...
    lib/m4sugar/m4sh.m4:697: AS_IF is expanded from...
    ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
    ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
    configure.ac:32: gl_INIT is expanded from...
    configure.ac:168: the top level

I assume your patch is correct and these warnings are harmless since
building programs with GCC 14 and 15 worked fine for me.

But I have pushed the attached patch to prevent this warning from
causing confusion.

Collin

>From 0f9fb17a13956721aa0ab8553f13a1f736492abd Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 8 Apr 2025 21:20:39 -0700
Subject: [PATCH] stddef-h: Silence autoconf warnings introduced in previous
 commit.

* m4/stddef_h.m4 (gl_STDDEF_H): Use AC_LANG_SOURCE inside call to
AC_COMPILE_IFELSE.
---
 ChangeLog      | 6 ++++++
 m4/stddef_h.m4 | 7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cf3e040ada..f213c4a4f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-08  Collin Funk  <collin.fu...@gmail.com>
+
+	stddef-h: Silence autoconf warnings introduced in previous commit.
+	* m4/stddef_h.m4 (gl_STDDEF_H): Use AC_LANG_SOURCE inside call to
+	AC_COMPILE_IFELSE.
+
 2025-04-08  Bruno Haible  <br...@clisp.org>
 
 	stddef-h: Make a configure test work with upcoming GCC 15.
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 13aff50e71..a6bc624314 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,5 +1,5 @@
 # stddef_h.m4
-# serial 18
+# serial 19
 dnl Copyright (C) 2009-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,
@@ -94,11 +94,12 @@ AC_DEFUN_ONCE([gl_STDDEF_H]
   dnl affects GCC 13 and 14.
   AC_CACHE_CHECK([whether <stddef.h> is idempotent],
     [gl_cv_stddef_idempotent],
-    [AC_COMPILE_IFELSE([
+    [AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+       [[
        #if __GNUC__ == 13 || __GNUC__ == 14
         #error "bug 114870 is present"
        #endif
-       ],
+       ]])],
        [gl_cv_stddef_idempotent="guessing yes"],
        [gl_cv_stddef_idempotent="guessing no"])
     ])
-- 
2.49.0

Reply via email to