From 3c28d0250d48a9885d7ba765051b111d340f7e25 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 26 May 2023 19:27:09 +0200 Subject: [PATCH] copy-file: Silence gcc warnings. * lib/copy-file.c: Add #pragma GCC diagnostic. --- ChangeLog | 7 ++++++- lib/copy-file.c | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 42e9faf964..ade2311f18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2023-05-24 Bruno Haible +2023-05-26 Bruno Haible + + copy-file: Silence gcc warnings. + * lib/copy-file.c: Add #pragma GCC diagnostic. + +2023-05-26 Bruno Haible diffseq: Silence gcc warning. * lib/diffseq.h: Add #pragma GCC diagnostic. diff --git a/lib/copy-file.c b/lib/copy-file.c index 78da3996bb..bd98b35e7e 100644 --- a/lib/copy-file.c +++ b/lib/copy-file.c @@ -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) { -- 2.39.5