]> Savannah Git Hosting - gnulib.git/commitdiff
tests: Silence some more -Wdeprecated-declarations warnings.
authorBruno Haible <bruno@clisp.org>
Wed, 20 Nov 2024 07:24:31 +0000 (08:24 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 20 Nov 2024 07:24:31 +0000 (08:24 +0100)
* tests/test-execute-child.c: Silence warning about sprintf.
* tests/test-fstatat.c: Silence warnings about statat and lstatat.
* tests/test-statat.c: Add comment.

ChangeLog
tests/test-execute-child.c
tests/test-fstatat.c
tests/test-statat.c

index 8cfb8d7102c416e108e28961c83ffefda0d2bebd..80e8b85760fe3061a85c85a419c48e2d0a8975c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-11-20  Bruno Haible  <bruno@clisp.org>
+
+       tests: Silence some more -Wdeprecated-declarations warnings.
+       * tests/test-execute-child.c: Silence warning about sprintf.
+       * tests/test-fstatat.c: Silence warnings about statat and lstatat.
+       * tests/test-statat.c: Add comment.
+
 2024-11-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        savewd: remove O_SEARCH optimization
index cf76fbc4fd3d5458e9d083545182ec212123a8b3..05016eaae0b69fbea6e5dd86e66ce0a3ee462262 100644 (file)
@@ -76,6 +76,12 @@ is_device (int fd)
 #undef strstr
 #undef write
 
+/* macOS 12's "warning: 'sprintf' is deprecated" is pointless,
+   as sprintf is used safely here.  */
+#if defined __APPLE__ && defined __MACH__ && _GL_GNUC_PREREQ (4, 2)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include "qemu.h"
 
 #if HAVE_MSVC_INVALID_PARAMETER_HANDLER
index 65c8010461f2dcb359373f7386263b25675d996a..3981b09d9a0250d5329118b28b10f0bcab156fc7 100644 (file)
@@ -34,6 +34,11 @@ SIGNATURE_CHECK (fstatat, int, (int, char const *, struct stat *, int));
 #include "ignore-value.h"
 #include "macros.h"
 
+/* This program tests deprecated functions 'statat' and 'lstatat'.  */
+#if _GL_GNUC_PREREQ (4, 3)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #ifndef BASE
 # define BASE "test-fstatat.t"
 #endif
index 0576f8f20487fa0ba0b5d8f22202db3c0cfa47e6..7a4632729dfb553a942e98b307c6f04320fa4c3f 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "openat.h"
 
+/* This program tests deprecated functions 'statat' and 'lstatat'.  */
 #if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif