]> Savannah Git Hosting - gnulib.git/commitdiff
verify tests: avoid -Wmissing-declarations warnings
authorBernhard Voelker <bernhard.voelker@camline.com>
Fri, 30 Oct 2020 01:46:44 +0000 (02:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 31 Oct 2020 11:42:15 +0000 (12:42 +0100)
* tests/test-verify.c (test_assume_expressions): Add declaration.
(test_assume_optimization): Likewise.
(test_assume_noreturn): Likewise.
(main): Move down after all other definitions.  While at it, also
call test_assume_expressions and test_assume_optimization as a
runtime check.

ChangeLog
tests/test-verify.c

index 4eb5bcb1dc1e499b05b3a67b80c545c6dd1bd1b1..8cc39d3863e8701c66622ac2f47d14a6fc025aa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-10-30  Bernhard Voelker  <mail@bernhard-voelker.de>
+
+       verify tests: avoid -Wmissing-declarations warnings
+       * tests/test-verify.c (test_assume_expressions): Add declaration.
+       (test_assume_optimization): Likewise.
+       (test_assume_noreturn): Likewise.
+       (main): Move down after all other definitions.  While at it, also
+       call test_assume_expressions and test_assume_optimization as a
+       runtime check.
+
 2020-10-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        sys_stat: update comments for S_IRWXUGO, S_IXUGO
index 05e113c0a93ca13660e13207e39a809a051e75eb..1ed78c930b4d955054097d6bc9b6e8f45c607ed7 100644 (file)
@@ -64,12 +64,6 @@ function (int n)
   return 0;
 }
 
-int
-main (void)
-{
-  return !(function (0) == 0 && function (1) == 8);
-}
-
 /* ============================== Test assume ============================== */
 
 static int
@@ -80,6 +74,10 @@ f (int a)
 
 typedef struct { unsigned int context : 4; unsigned int halt : 1; } state;
 
+void test_assume_expressions (state *s);
+int test_assume_optimization (int x);
+void test_assume_noreturn (void);
+
 void
 test_assume_expressions (state *s)
 {
@@ -109,3 +107,13 @@ test_assume_noreturn (void)
      This function should not elicit a warning.  */
   assume (0);
 }
+
+/* ============================== Main ===================================== */
+int
+main (void)
+{
+  state s;
+  test_assume_expressions (&s);
+  test_assume_optimization (5);
+  return !(function (0) == 0 && function (1) == 8);
+}