]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Consistently use block comments at beginning of C99 and C11 tests
authorDetlef Riekenberg <wine.dev@web.de>
Sat, 3 Sep 2022 23:57:25 +0000 (01:57 +0200)
committerZack Weinberg <zack@owlfolio.org>
Tue, 12 Dec 2023 20:23:16 +0000 (15:23 -0500)
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

index 77ff1af8e3d146ec9efe258fefe9a2b262bcca5e..6cdef6fae098b96c807312c4c585db716e730681 100644 (file)
@@ -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