autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] [committed] Consistently use block comments at beginning of C99


From: Zack Weinberg
Subject: [PATCH] [committed] Consistently use block comments at beginning of C99 and C11 tests
Date: Tue, 12 Dec 2023 15:51:55 -0500

From: Detlef Riekenberg <wine.dev@web.de>

Purely cosmetic improvement to the C standard version tests: Use /* */
comments above all three checks of __STDC__ and/or __STDC_VERSION__,
and make “// See if C++-style comments work” the very first // comment.

Resolves issue #110713.

* c.m4 (_AC_C_C99_TEST_GLOBALS, _AC_C_C11_TEST_GLOBALS):
  Improve stylistic consistency with _AC_C_C89_TEST_GLOBALS.
  Move explicit test of C++-style comments earlier.
---
 lib/autoconf/c.m4 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 77ff1af8..6cdef6fa 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1193,11 +1193,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 *, ...);
@@ -1253,7 +1255,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)
@@ -1348,7 +1349,7 @@ AC_DEFUN([_AC_C_C11_TEST_GLOBALS],
 [m4_divert_text([INIT_PREPARE],
 [[# Test code for whether the C compiler supports C11 (global declarations)
 ac_c_conftest_c11_globals='
-// Does the compiler advertise C11 conformance?
+/* Does the compiler advertise C11 conformance? */
 #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
 # error "Compiler does not advertise C11 conformance"
 #endif
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]