From: Detlef Riekenberg Date: Sat, 3 Sep 2022 23:57:25 +0000 (+0200) Subject: Consistently use block comments at beginning of C99 and C11 tests X-Git-Tag: v2.72e~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba719bedba517b501473b3d86af5202f379fced8;p=thirdparty%2Fautoconf.git Consistently use block comments at beginning of C99 and C11 tests 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. --- diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 77ff1af8e..6cdef6fae 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 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