minor noises made by gcc and -std=iso9899:1999 with -Wall -pedantic -Wextra -pedantic-errors

Vincent Lefevre vincent at vinc17.net
Mon Jul 1 14:50:14 UTC 2019

On 2019-07-01 14:45:03 +0200, Torbjorn Granlund wrote:
> Vincent Lefevre <vincent at vinc17.net> writes:
>   MPFR uses in a #else part:
>   /* Avoid an empty translation unit (see ISO C99, 6.9) */
>   typedef int foo;
>   This is rather important, because even if the compiler can generate
>   code, the behavior of this code is undefined[*] (I don't see why there
>   would be any issue, but as compilers become more and more complex,
>   who knows...), thus one might silently get wrong results.
> GMP has not yet been ported to any system/compiler which causes problems
> for empty "translation units".

There is nothing in the GMP manual that tells the user not to use
-pedantic-errors (an option that should not break portable programs).

Note: This option (which covers much more than empty translation units)
can be useful for his own programs and possibly other programs, and
might been enabled globally as a consequence.

> I (still) believes development time is best used for solving actual
> problem rather than hypothetical ones.  Also, if we silence pointless
> warnings from compilers by making the code slower and/or harder to read,
> that's not an improvement in my world.

Not hypothetical, as I've explained just above. The development time
of the other users is valuable too.

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-discuss mailing list