]> Savannah Git Hosting - gnulib.git/commitdiff
tests: suppress some unwanted -fanalyzer checking
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 24 Apr 2023 19:06:54 +0000 (12:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 24 Apr 2023 19:07:39 +0000 (12:07 -0700)
* tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h:
* tests/test-getdtablesize.c, tests/test-listen.c:
* tests/test-localename.c, tests/test-open.h, tests/test-perror2.c:
* tests/test-select.h:
Add pragmas to disable unwanted -fanalyzer checking.

ChangeLog
tests/test-dup2.c
tests/test-fcntl.c
tests/test-fopen.h
tests/test-getdtablesize.c
tests/test-listen.c
tests/test-localename.c
tests/test-open.h
tests/test-perror2.c
tests/test-select.h

index 0420fa8c9eaaa65d3d03c04b34decb41c7813fad..5a082f25378df8c8ae6113564d62c621f508b5fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-04-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tests: suppress some unwanted -fanalyzer checking
+       * tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h:
+       * tests/test-getdtablesize.c, tests/test-listen.c:
+       * tests/test-localename.c, tests/test-open.h, tests/test-perror2.c:
+       * tests/test-select.h:
+       Add pragmas to disable unwanted -fanalyzer checking.
+
 2023-04-24  Bruno Haible  <bruno@clisp.org>
 
        ftell, ftello: Fix recognition of pipes on native Windows.
index 85133ea1e4ddf05f247deedbd031763558b90ee4..e7957271ad271257d9501984187dcd57fbc37a10 100644 (file)
@@ -50,6 +50,12 @@ SIGNATURE_CHECK (dup2, int, (int, int));
 
 #include "macros.h"
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-use-without-check"
+#endif
+
 /* Return non-zero if FD is open.  */
 static int
 is_open (int fd)
index 4206de991ab6b49c61085e806ed75670f18b135e..c2b7377b59584e9f5aa4b9b09a807fc0c1ec4585 100644 (file)
@@ -44,6 +44,14 @@ SIGNATURE_CHECK (fcntl, int, (int, int, ...));
 #include "binary-io.h"
 #include "macros.h"
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+#endif
+#if __GNUC__ >= 13
+# pragma GCC diagnostic ignored "-Wanalyzer-va-arg-type-mismatch"
+#endif
+
 #if !O_BINARY
 # define set_binary_mode(f,m) zero ()
 static int zero (void) { return 0; }
index a03c931816e74cbc4c3fb7d334909d13016ca1dd..751afd8c61753d08b625efaac7a0b4fcd513a2ff 100644 (file)
 
 #include "macros.h"
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
+#endif
+
 /* Test fopen.  Assumes BASE is defined.  */
 
 static int
index 46a546feadf798c769496e6b29eb0a646bfff4ed..4eb28d9b1e6e5fba309c24d87a0c67ac37c89f5a 100644 (file)
@@ -25,6 +25,11 @@ SIGNATURE_CHECK (getdtablesize, int, (void));
 
 #include "macros.h"
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+#endif
+
 int
 main (int argc, char *argv[])
 {
index 43b86a8bb039a25e9a6a187872652b8af4c35230..b245e48f3ad9c5d3bb1b59a637ad47e00e15bc4d 100644 (file)
@@ -27,6 +27,11 @@ SIGNATURE_CHECK (listen, int, (int, int));
 #include "sockets.h"
 #include "macros.h"
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-use-without-check"
+#endif
+
 int
 main (void)
 {
index d56d14ed0a808137a569749ff81cca9fae7a7e49..090afeb5383d1f062cee9607490981341ed80502 100644 (file)
 # define freelocale(loc) ((void) (loc))
 #endif
 
+/* Suppress GCC false positive.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"
+#endif
 
 #if HAVE_GOOD_USELOCALE
 
index 18549c4c4f47ca67f1152a036d91a5b031db8c8d..f01523dc16df3f09cc1b52aa1365934d3bf2c752 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+#endif
+
 /* Make test_open always inline if we're using Fortify, which defines
    __always_inline to do that.  Do nothing otherwise.  This works
    around a glibc bug whereby 'open' cannot be used as a function
index de124803221ca088ad7783c12c1214a645a86079..0c96832d37cb1174666bc773839b380ab673165f 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+/* Tell GCC not to warn about myerr being leaked.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+#endif
+
 /* This test intentionally parses stderr.  So, we arrange to have fd 10
    (outside the range of interesting fd's during the test) set up to
    duplicate the original stderr.  */
index ceeb4854713b0d8e87622c6197dc69157c153f6b..af840d2bc896076c3563d27038118ea752f824eb 100644 (file)
 # include <sys/wait.h>
 #endif
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if __GNUC__ >= 10
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-use-without-check"
+#endif
 
 typedef int (*select_fn) (int, fd_set *, fd_set *, fd_set *, struct timeval *);