Hi Paul,
> I have a bug report for a compiler error in GNU Make, using
> intprops-internal.h, on Debian 10 with GCC 8.3:
>
> https://savannah.gnu.org/bugs/?65537
>
> This is with gnulib stable-202401 current Git HEAD.
>
> Thoughts? Maybe I just have to disable this warning?
>
>
> Note, I already do not enable -Werror etc. by default in source
> distributions so this wouldn't be seen by a user of an official
> release, but this user is building straight from the Git repository and
> I usually enable all warnings + -Werror for these builds.
Regarding warnings and -Werror, there is some text in the Gnulib
documentation:
* The last paragraph of
https://www.gnu.org/software/gnulib/manual/html_node/warnings.html
says:
"‘gl_WARN_ADD([-Werror])’ is intended for developers, and should
be avoided in contexts where it would affect ordinary installation
builds. The warnings emitted by GCC depend, to some extent, on the
contents of the system header files, on the size and signedness of
built-in types, etc. Use of ‘-Werror’ would cause frustration to
all users on platforms that the maintainer has not tested before
the release. It is better if ‘-Werror’ is off by default, and is
enabled only by developers."
The problem with your git repository setup (maintMakefile line 32,
that enables -Werror by default) is that in practice, it's not
only developers who build from git repositories. Namely, many people
whose habits have been shaped by GitHub will look for the git
repository before looking for a release tarball. And these people
use other platforms (this user was on a 4-years old Debian,
other users may be on OpenBSD or whatever) with other compilers
than you use (not GCC 13, but GCC 8 or clang). *Even* if you have
eliminated all warnings with GCC 13, these other compilers often
spew more warnings, and -Werror magnifies them into errors.
* The last paragraph of
https://www.gnu.org/software/gnulib/manual/html_node/manywarnings.html
explains why -Wsign-compare, in particular, is a waste of time.
However, you have (in maintMakefile line 32) enabled -Wextra, which
implies -Wsign-compare [1].
So, while Paul Eggert has been able to come up with a patch for one of the
warnings, the general cause of this bug report is in the build system of the
GNU Make project.
I would invite you to fix both problems:
- Add -Wno-sign-compare to the warning options.
- Do *not* enable -Werror for all users who build from the git repository.
Further reading:
- The 'manywarnings' documentation
https://www.gnu.org/software/gnulib/manual/html_node/manywarnings.html
- The coreutils warnings configuration.
- The gettext warnings configuration
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=m4/more-warnings.m4
Bruno
[1] https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Warning-Options.html