Re: warnings in unit tests

2021-06-09 Thread Bruno Haible
Paul Eggert wrote: > For the -Wnull-dereference issue it may be worthwhile to use a > circumlocution that fools GCC into not issuing the warning. After all, a > compiler smart enough to warn about '*(volatile int *) 0 = 42' might > also be smart enough to see that it's undefined behavior and the

Re: warnings in unit tests

2021-06-09 Thread Bruno Haible
Bernhard Voelker wrote: > One little aspect of the tests code is that people might look (also) there to > learn how to use a certain gnulib module, and then copy/paste the code from > there into their projects. Yes, a secondary value of the unit tests is to show how the APIs can be correctly used.

Re: warnings in unit tests

2021-06-09 Thread Dmitry V. Levin
On Tue, Jun 08, 2021 at 09:42:55AM -0700, Paul Eggert wrote: > For what it's worth I'm more with Bruno on this. For the tests, the cost > of these warnings outweighs the benefit. > > It'd be OK with me to disable the troublesome warnings globally for the > tests subdirectory, using -Wno-missing-

Re: warnings in unit tests

2021-06-09 Thread Bernhard Voelker
On 6/8/21 12:57 PM, Bruno Haible wrote: > The difference between lib/ and tests/ is that code in lib/ goes into > the binaries delivered by the packages, and therefore if a package > maintainer makes an effort to silence a warning, we will consider > their patch. Whereas for tests, as I said, it is