[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lib/malloca.c: warning about [-Wsign-compare]
From: |
Simon Josefsson |
Subject: |
Re: lib/malloca.c: warning about [-Wsign-compare] |
Date: |
Fri, 23 Sep 2022 09:08:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Paul Eggert <eggert@cs.ucla.edu> writes:
> On 9/22/22 11:20, Bjarni Ingi Gislason wrote:
>
>> CC='clang -Wsign-compare' ./gnulib-tool --test malloca 2>
>
> Oh, please don't use -Wsign-compare. Clang generates too many false
> alarms with -Wsign-compare, we don't recommend that warning, and
> Gnulib-using programs generally don't enable that warning when
> compiling Gnulib code.
>
> If you happen to find a real bug with that warning we'd like to know
> it. But please don't bother us with the false alarms; they're not
> worth your time or ours.
I added a similar comment to the manual: it is handy with a reference
for people like me who cannot remember all different warning flags and
whether they are generally useful or not.
/Simon
From 54c09c98a67219ba2cf70c4bb23f80990db37066 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Fri, 23 Sep 2022 09:06:22 +0200
Subject: [PATCH] warnings, manywarnings: Doc fixes.
* doc/manywarnings.texi (manywarnings): Improve usage instruction.
Start list of comments on particular warning flags, based on
comment from Paul Eggert <eggert@cs.ucla.edu>.
* doc/warnings.texi (warnings): Mention that it is often used with manywarnings.
---
ChangeLog | 8 ++++++++
doc/manywarnings.texi | 14 +++++++++++++-
doc/warnings.texi | 4 +++-
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a6399f1048..5b5804df68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-23 Simon Josefsson <simon@josefsson.org>
+
+ warnings, manywarnings: Doc fixes.
+ * doc/manywarnings.texi (manywarnings): Improve usage instruction.
+ Start list of comments on particular warning flags, based on
+ comment from Paul Eggert <eggert@cs.ucla.edu>.
+ * doc/warnings.texi (warnings): Mention that it is often used with
manywarnings.
+
2022-09-21 Paul Eggert <eggert@cs.ucla.edu>
assert-h: suppress clang false alarms
diff --git a/doc/manywarnings.texi b/doc/manywarnings.texi
index 1b3e5907be..7ab3f09cee 100644
--- a/doc/manywarnings.texi
+++ b/doc/manywarnings.texi
@@ -32,7 +32,7 @@ go through the list of warnings. You will likely deactivate
warnings that
occur often and don't point to mistakes in the code, by adding them to the
@samp{nw} variable, then reconfiguring and recompiling. When warnings point
to real mistakes and bugs in the code, you will of course not disable
-them.
+them but fix your code to silence the warning instead.
There are also many GCC warning options which usually don't point to mistakes
in the code; these warnings enforce a certain programming style. It is a
@@ -44,3 +44,15 @@ When a new version of GCC is released, you can add the new
warning options
that it introduces into the @code{gl_MANYWARN_ALL_GCC} macro (and submit your
modification to the Gnulib maintainers :-)), and enjoy the benefits of the
new warnings, while adding the undesired ones to the @samp{nw} variable.
+
+Comments on particular warning flags:
+
+@table @samp
+
+@item -Wsign-compare
+Clang generates too many false alarms with -Wsign-compare, and we don't
+recommend that warning. Programs using Gnulib generally don't enable
+that warning when compiling Gnulib code. If you happen to find a real
+bug with that warning we'd like to know it.
+
+@end table
diff --git a/doc/warnings.texi b/doc/warnings.texi
index 1836c04325..47ce633250 100644
--- a/doc/warnings.texi
+++ b/doc/warnings.texi
@@ -2,7 +2,9 @@
@section warnings
The @code{warnings} module allows to regularly build a package with more
-GCC warnings than the default warnings emitted by GCC.
+GCC warnings than the default warnings emitted by GCC. It is often used
+indirectly through the @code{manywarnings} module
+(@pxref{manywarnings}).
It provides the following functionality:
--
2.30.2
signature.asc
Description: PGP signature