[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 167bf3408e4: Pacify clang 15.0.6 on Fedora 37
From: |
Paul Eggert |
Subject: |
master 167bf3408e4: Pacify clang 15.0.6 on Fedora 37 |
Date: |
Thu, 19 Jan 2023 22:07:40 -0500 (EST) |
branch: master
commit 167bf3408e437704b27171c6fad5d15bbc623b3a
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Pacify clang 15.0.6 on Fedora 37
* configure.ac: Suppress clang -Wbitwise-instead-of-logical,
as there’s nothing wrong with using & and | on bool.
* src/coding.c: Suppress -Wunused-but-set-variable in this file,
as it’s too much trouble to recode to pacify clang.
---
configure.ac | 1 +
src/coding.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index d7aec4414e3..fc17dbd8318 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1139,6 +1139,7 @@ AS_IF([test $gl_gcc_warnings = no],
# clang is unduly picky about some things.
if test "$emacs_cv_clang" = yes; then
+ gl_WARN_ADD([-Wno-bitwise-instead-of-logical])
gl_WARN_ADD([-Wno-missing-braces])
gl_WARN_ADD([-Wno-null-pointer-arithmetic])
gl_WARN_ADD([-Wno-implicit-const-int-float-conversion])
diff --git a/src/coding.c b/src/coding.c
index 49dcd8634f3..79461addd1a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -651,6 +651,12 @@ growable_destination (struct coding_system *coding)
consumed_chars++; \
} while (0)
+/* Suppress clang warnings about consumed_chars never being used.
+ Although correct, the warnings are too much trouble to code around. */
+#if 13 <= __clang_major__
+# pragma clang diagnostic ignored "-Wunused-but-set-variable"
+#endif
+
/* Safely get two bytes from the source text pointed by SRC which ends
at SRC_END, and set C1 and C2 to those bytes while skipping the
heading multibyte characters. If there are not enough bytes in the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 167bf3408e4: Pacify clang 15.0.6 on Fedora 37,
Paul Eggert <=