]> Savannah Git Hosting - gnulib.git/commitdiff
copy-file: Silence gcc warnings.
authorBruno Haible <bruno@clisp.org>
Fri, 26 May 2023 17:27:09 +0000 (19:27 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 26 May 2023 17:27:09 +0000 (19:27 +0200)
* lib/copy-file.c: Add #pragma GCC diagnostic.

ChangeLog
lib/copy-file.c

index 42e9faf96424ede63dbb21320e68af9c6f6541bd..ade2311f18184104ab41b2caf9adade9cc1b6391 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2023-05-24  Bruno Haible  <bruno@clisp.org>
+2023-05-26  Bruno Haible  <bruno@clisp.org>
+
+       copy-file: Silence gcc warnings.
+       * lib/copy-file.c: Add #pragma GCC diagnostic.
+
+2023-05-26  Bruno Haible  <bruno@clisp.org>
 
        diffseq: Silence gcc warning.
        * lib/diffseq.h: Add #pragma GCC diagnostic.
index 78da3996bb94af70397a69e3fd93120c530ada91..bd98b35e7eb299667890a94599d2052d447f5ad8 100644 (file)
@@ -180,6 +180,13 @@ qcopy_file_preserving (const char *src_filename, const char *dest_filename)
   return err;
 }
 
+/* Silence gcc warnings "this statement may fall through".
+   gcc cannot know that error(), when invoked with a non-zero status argument,
+   will not return.  */
+#if __GNUC__ >= 7
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
 void
 copy_file_preserving (const char *src_filename, const char *dest_filename)
 {