clang warning about mini-gmp.c when used in Emacs

Vincent Lefevre vincent at vinc17.net
Wed Apr 20 04:11:58 CEST 2022


On 2022-04-19 20:16:51 +0200, Niels Möller wrote:
> I've always liked gcc -Wall. I think it adheres to its design to warn
> only about things that (1) are prone to be errors, and (2) in the case
> that they aren't errors, are easy to clarify in a way that makes the
> compiler stop warning about them.
> 
> Use of -Werror, on the other hand, is something that I can't generally
> recommend. Imposing it on library users by default is certainly a bad
> idea. Using it when compiling tests that are part of configure is almost
> sure to break.
> 
> But it could make sense to enable in certain nightly builds with known
> compilers, if one has the ambition that the code should build without
> (certain) warnings in that configuration, and stay that way.

-Werror may be useful for developers in order to automatically find
potential errors in new code, but it may be necessary to disable some
errors.

I generally test MPFR with

  -Wall -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations -Wmissing-field-initializers -Wimplicit-fallthrough -Wcast-function-type -Wcast-align=strict -Wwrite-strings -Wno-error=unused-function -Werror -fsanitize=undefined -fno-sanitize-recover

and

  -std=c90 -pedantic -Wall -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations -Wmissing-field-initializers -Wimplicit-fallthrough -Wcast-function-type -Wcast-align=strict -Wwrite-strings -Wno-error=unused-function -Wno-error=overlength-strings -Werror

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list