minor noises made by gcc and -std=iso9899:1999 with -Wall -pedantic -Wextra -pedantic-errors
Dennis Clarke
dclarke at blastwave.org
Mon Jul 1 18:09:00 UTC 2019
On 7/1/19 8:40 AM, Torbjörn Granlund wrote:
> Vincent Lefevre <vincent at vinc17.net> writes:
>
> However the GMP code is poorly written.
>
> mp_size_t n = 1 + (2 * an >= 3 * bn ? (an - 1) / (size_t) 3 : (bn - 1) >> 1);
>
> What's the point of the cast to size_t?
>
> It is a slight performance optimisation.
>
> Moreover, GMP favors signed arithmetic with a signed type mp_size_t,
> thus artificially switching to unsigned arithmetic with this cast is
> a bad idea.
>
> Why? We have full control of the ranges of the involved variables.
>
Well the objective here was that I was attempting to drag gmpbench into
the C99 compliance and for that purpose I had built gmp into /opt/bw
with strict c99 flags etc etc.
Seems to work thus far : https://github.com/blastwave/gmpbench_c99
See verbose readme there.
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
More information about the gmp-discuss
mailing list