]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
tests: simplify test_exit_status decl
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 May 2025 06:16:15 +0000 (23:16 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 May 2025 06:16:38 +0000 (23:16 -0700)
* tests/macros.h (test_exit_status) [!NO_MAIN_HERE]:
Declare test_exit_status too, as this is simpler
and we might as well check definition vs declaration.

ChangeLog
tests/macros.h

index 09c5b008dfac2e8a9fa1fcec00c77831a417071c..75792d4fe22260302e7918bb50b684457d5a106d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-05-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tests: simplify test_exit_status decl
+       * tests/macros.h (test_exit_status) [!NO_MAIN_HERE]:
+       Declare test_exit_status too, as this is simpler
+       and we might as well check definition vs declaration.
+
 2025-05-18  Bruno Haible  <bruno@clisp.org>
 
        unigbrk/u*-grapheme-prev: Support Indic, Emojis, regional indicators.
index a6ac1c9f3be2954c3a855dc468e3c64ae617ed0d..e65d8ebdc926493eb4de9abbc73ee78d24ae326b 100644 (file)
@@ -56,9 +56,8 @@
    Set to EXIT_FAILURE when an ASSERT or ASSERT_NO_STDIO fails.  */
 /* To satisfy the "one definition rule", we define the variable in the
    compilation unit that contains the main() function.  */
-#ifdef NO_MAIN_HERE
 extern int volatile test_exit_status;
-#else
+#ifndef NO_MAIN_HERE
 int volatile test_exit_status = EXIT_SUCCESS;
 #endif