Using __STDC_VERSION__ as first test for C99 looks better and is similar to the 
C89 and C11 tests.

Resynced to current git

--
Regards, Detlef


From bc14044f81d4ee31e9823e58a06baabae19e10de Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine....@web.de>
Date: Thu, 2 Feb 2023 23:31:24 +0100
Subject: [PATCH] c.m4: Move C++ comments to use __STDC_VERSION__ as the first test for C99

Using __STDC_VERSION__ as first test for C99 looks better and is similar to the C89 and C11 tests

--
Regards, Detlef

---
 lib/autoconf/c.m4 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index fef6c516d..e02495abf 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1200,11 +1200,13 @@ AC_DEFUN([_AC_C_C99_TEST_GLOBALS],
 [m4_divert_text([INIT_PREPARE],
 [[# Test code for whether the C compiler supports C99 (global declarations)
 ac_c_conftest_c99_globals='
-// Does the compiler advertise C99 conformance?
+/* Does the compiler advertise C99 conformance? */
 #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
 # error "Compiler does not advertise C99 conformance"
 #endif

+// See if C++-style comments work.
+
 #include <stdbool.h>
 extern int puts (const char *);
 extern int printf (const char *, ...);
@@ -1260,7 +1262,6 @@ typedef const char *ccp;
 static inline int
 test_restrict (ccp restrict text)
 {
-  // See if C++-style comments work.
   // Iterate through items via the restricted pointer.
   // Also check for declarations in for loops.
   for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
--
2.34.1

Reply via email to