[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warnings in unit tests
From: |
Dmitry V. Levin |
Subject: |
Re: warnings in unit tests |
Date: |
Wed, 9 Jun 2021 03:41:02 +0300 |
On Tue, Jun 08, 2021 at 10:56:33AM +0200, Bruno Haible wrote:
> 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.
Unlike many other gcc warnings, -Wmissing-prototypes is especially useful
because it doesn't report false positives, so I don't see why one may want
to turn -Wmissing-prototypes off.
In case of recurse_1(), the function isn't declared static for a specific
reason that isn't obvious for casual readers. In such cases it's usually
a good idea to add a comment explaining why this case is different from
the common pattern.
--
ldv
- Re: new module 'sigsegv', Dmitry V. Levin, 2021/06/06
- Re: new module 'sigsegv', Bruno Haible, 2021/06/06
- Re: new module 'sigsegv', Dmitry V. Levin, 2021/06/07
- Re: new module 'sigsegv', Jim Meyering, 2021/06/07
- warnings in unit tests, Bruno Haible, 2021/06/07
- Re: warnings in unit tests, Jim Meyering, 2021/06/08
- Re: warnings in unit tests, Bruno Haible, 2021/06/08
- Re: warnings in unit tests,
Dmitry V. Levin <=
- Re: warnings in unit tests, Bruno Haible, 2021/06/10
- Message not available
- Re: warnings in unit tests, Bruno Haible, 2021/06/08
- Re: warnings in unit tests, Paul Eggert, 2021/06/08
- Re: warnings in unit tests, Dmitry V. Levin, 2021/06/09
- Re: warnings in unit tests, Bruno Haible, 2021/06/09
- Re: warnings in unit tests, Bruno Haible, 2021/06/10
- Re: warnings in unit tests, Bernhard Voelker, 2021/06/09
- Re: warnings in unit tests, Bruno Haible, 2021/06/09
- Re: warnings in unit tests, Simon Josefsson, 2021/06/10
- Re: warnings in unit tests, Bruno Haible, 2021/06/10