+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.
#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)
#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; }
#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
#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[])
{
#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)
{
# 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
/* 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
#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. */
# 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 *);