I accidentally ran 'make check' in Gnulib (wrong terminal window), but
it ended up being useful. I saw:

    File lib/options.h lacks a config.h reminder. Needed for: _GL_GNUC_PREREQ
    File lib/stdcountof.in.h lacks a config.h reminder. Needed for: 
_GL_GNUC_PREREQ

This is correct since lib/gnulib-common.m4 will emit a _GL_GNUC_PREREQ
definition in config.h. We must include it before these headers so it is
defined.

Done with the two attached patches.

Collin

>From adad3d69237190d12ad15abb077ed8ff6eb0ca3b Mon Sep 17 00:00:00 2001
Message-ID: <adad3d69237190d12ad15abb077ed8ff6eb0ca3b.1752015689.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 8 Jul 2025 15:57:36 -0700
Subject: [PATCH 1/2] stdcountof-h: Add reminder to include <config.h>.

* lib/stdcountof.in.h: Check that config.h was already included.
---
 ChangeLog           | 5 +++++
 lib/stdcountof.in.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index d09840c10d..02db58e594 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-07-08  Collin Funk  <collin.fu...@gmail.com>
+
+	stdcountof-h: Add reminder to include <config.h>.
+	* lib/stdcountof.in.h: Check that config.h was already included.
+
 2025-07-07  Bruno Haible  <br...@clisp.org>
 
 	float-h: Enforce the ISO C 23 compliant value for LDBL_EPSILON.
diff --git a/lib/stdcountof.in.h b/lib/stdcountof.in.h
index 683b1c7156..d5def6bf57 100644
--- a/lib/stdcountof.in.h
+++ b/lib/stdcountof.in.h
@@ -18,6 +18,11 @@
 #ifndef _GL_STDCOUNTOF_H
 #define _GL_STDCOUNTOF_H
 
+/* This file uses _GL_GNUC_PREREQ.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Get size_t.  */
 #include <stddef.h>
 
-- 
2.50.0

>From 697bc7c04c1bd92b27d83de88ae82347b04a37a2 Mon Sep 17 00:00:00 2001
Message-ID: <697bc7c04c1bd92b27d83de88ae82347b04a37a2.1752015689.git.collin.fu...@gmail.com>
In-Reply-To: <adad3d69237190d12ad15abb077ed8ff6eb0ca3b.1752015689.git.collin.fu...@gmail.com>
References: <adad3d69237190d12ad15abb077ed8ff6eb0ca3b.1752015689.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 8 Jul 2025 15:59:08 -0700
Subject: [PATCH 2/2] options: Add reminder to include <config.h>.

* lib/options.h: Check that config.h was already included.
---
 ChangeLog     | 3 +++
 lib/options.h | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 02db58e594..f52a907487 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-07-08  Collin Funk  <collin.fu...@gmail.com>
 
+	options: Add reminder to include <config.h>.
+	* lib/options.h: Check that config.h was already included.
+
 	stdcountof-h: Add reminder to include <config.h>.
 	* lib/stdcountof.in.h: Check that config.h was already included.
 
diff --git a/lib/options.h b/lib/options.h
index 66d8710ca4..7a4a266f84 100644
--- a/lib/options.h
+++ b/lib/options.h
@@ -19,6 +19,11 @@
 #ifndef _OPTIONS_H
 #define _OPTIONS_H
 
+/* This file uses _GL_GNUC_PREREQ.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* This file provides a more convenient API to parsing program options,
    based on GNU getopt_long() and thus compatible with the option parsing
    conventions for GNU programs
-- 
2.50.0

Reply via email to