bug-gnulib
[Top][All Lists]
Advanced

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

argmatch tests: Fix ISO C compliance warning


From: Bruno Haible
Subject: argmatch tests: Fix ISO C compliance warning
Date: Sat, 05 Sep 2020 16:42:57 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

When compiling a gnulib testdir with CC="gcc -std=gnu99 -pedantic" I see
this warning:

test-argmatch.c:64:48: warning: ISO C does not allow extra ‘;’ outside of a 
function [-Wpedantic]
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
                                                ^

This patch should fix it. It is probably preferrable to adding
   typedef int dummy_ ## __LINE__
at the end of the macro.


2020-09-05  Bruno Haible  <bruno@clisp.org>

        argmatch tests: Fix ISO C compliance warning.
        * tests/test-argmatch.c: Omit semicolon after ARGMATCH_DEFINE_GROUP
        invocation.

diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c
index 24a0500..89a62ef 100644
--- a/tests/test-argmatch.c
+++ b/tests/test-argmatch.c
@@ -61,7 +61,7 @@ static const enum backup_type backup_vals[] =
   numbered_backups, numbered_backups, numbered_backups
 };
 
-ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
+ARGMATCH_DEFINE_GROUP(backup, enum backup_type)
 
 static const argmatch_backup_doc argmatch_backup_docs[] =
 {




reply via email to

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