bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Jim Meyering <jim@meyering.net>
Cc: bug-gnulib@gnu.org
Subject: Re: warnings in unit tests
Date: Tue, 08 Jun 2021 10:56:33 +0200	[thread overview]
Message-ID: <2086778.xA2Ij3oMRU@omega> (raw)
In-Reply-To: <CA+8g5KH=p2zo1JERfQpfjO4ouXqOikKWGFw++gwdmuKTNwZv2A@mail.gmail.com>

Jim Meyering wrote:
> I can live without -Wmissing-prototypes in gnulib tests, but I still
> remember times where using that option exposed a real bug.

-Wmissing-prototypes typically exposes real bugs when a program is composed
of several compilation units. Unit tests are typically a single compilation
unit plus libtests.a, and libtests.a being built from modules with .h / .c
combinations it does not have the kind of bug that -Wmissing-prototypes can
detect.

Anyway, the main point is that I, as the author of 75% of the Gnulib tests
and maintainer of the Gnulib tests, trust a certain set of GCC warnings
(namely, '-Wall -ftrapv'), as they have proven useful for these tests. If
a maintainer of a different package trusts a different set of GCC warnings
or clang warnings or the warnings of some other tool, they are welcome to
report bugs that they found this way. But they are not welcome to force
their preferred set of warning options onto the Gnulib tests, because that
means additional maintenance costs, which goes against the goal of having
a high test coverage.

> My point about the cost/benefit was regarding that 3-line addition for
> a single, deliberate NULL-deref.
> That one really does not deserve to quash -Wnull-dereference for all tests.

Compilers are getting more and more knowledge about POSIX functions.
Over time, they will warn about more and more of the corner cases that
the Gnulib test suite exercises. So, it's not only about the deliberate
pointer access here.

Jeffrey Walton is doing sanitizer-enabled testing of Gnulib. This has
proven to be more useful than listening to large amounts of GCC or clang
warning options.

Bruno



  reply	other threads:[~2021-06-08  8:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-16 17:01 new module 'sigsegv' Bruno Haible
2021-06-06 23:27 ` Dmitry V. Levin
2021-06-07  0:49   ` Bruno Haible
2021-06-07 10:29     ` Dmitry V. Levin
2021-06-08  1:45       ` Jim Meyering
2021-06-08  2:40         ` warnings in unit tests Bruno Haible
2021-06-08  5:55           ` Jim Meyering
2021-06-08  8:56             ` Bruno Haible [this message]
2021-06-09  0:41               ` Dmitry V. Levin
2021-06-10 20:05                 ` Bruno Haible
     [not found]             ` <CAH8yC8kHTq5J9onJj+2jwy_DwzXrwujqFs9TEBxGh5k_KCu=kg@mail.gmail.com>
2021-06-08 10:57               ` Bruno Haible
2021-06-08 16:42                 ` Paul Eggert
2021-06-09 13:35                   ` Dmitry V. Levin
2021-06-09 19:38                   ` Bruno Haible
2021-06-10 19:39                   ` Bruno Haible
2021-06-09  7:23                 ` Bernhard Voelker
2021-06-09 14:17                   ` Bruno Haible
2021-06-10  8:13                     ` Simon Josefsson via Gnulib discussion list
2021-06-10 19:51                       ` Bruno Haible
2021-06-10 21:49                         ` Simon Josefsson via Gnulib discussion list
2021-06-11 12:21                         ` Eric Blake
2021-06-11 13:57                           ` Bruno Haible
2021-06-19 12:02 ` new module 'sigsegv' Bruno Haible
2021-06-21 18:22   ` [PATCH] sigsegv, sigsegv-tests: Assign my contributions to the FSF Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2024-04-28  6:52 Pacify -Wmissing-variable-declarations in unit tests Collin Funk
2024-04-28 23:27 ` Paul Eggert
2024-04-29  0:58   ` Collin Funk
2024-04-29 22:12     ` warnings " Bruno Haible
2024-04-30  0:31       ` Collin Funk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2086778.xA2Ij3oMRU@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=jim@meyering.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).