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

Dennis Clarke dclarke at blastwave.org
Sun Jun 30 00:32:07 UTC 2019


Just figured I'd post this :

.
.
.
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_diveby3 -I/opt/bw/include 
-D_POSIX_PTHREAD_SEMANTICS -D_TS_ERRNO -std=iso9899:1999 -m32 -g -Wall 
-pedantic -Wextra -pedantic-errors -march=i686 -mtune=i686 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin -malign-double 
-mpc80 -D_LARGEFILE64_SOURCE -c diveby3.c  -fPIC -DPIC -o .libs/diveby3.o
In file included from diveby3.c:32:
../gmp-impl.h: In function 'mpn_toom32_mul_itch':
../gmp-impl.h:5120:65: warning: operand of ?: changes signedness from 
'long int' to 'long unsigned int' due to unsignedness of other operand 
[-Wsign-compare]
    mp_size_t n = 1 + (2 * an >= 3 * bn ? (an - 1) / (size_t) 3 : (bn - 
1) >> 1);
 
^~~~~~~~~~~~~
../gmp-impl.h: In function 'mpn_toom43_mul_itch':
../gmp-impl.h:5136:41: warning: operand of ?: changes signedness from 
'long int' to 'long unsigned int' due to unsignedness of other operand 
[-Wsign-compare]
    mp_size_t n = 1 + (3 * an >= 4 * bn ? (an - 1) >> 2 : (bn - 1) / 
(size_t) 3);
                                          ^~~~~~~~~~~~~
../gmp-impl.h: In function 'mpn_toom52_mul_itch':
../gmp-impl.h:5144:65: warning: operand of ?: changes signedness from 
'long int' to 'long unsigned int' due to unsignedness of other operand 
[-Wsign-compare]
    mp_size_t n = 1 + (2 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 
1) >> 1);
 
^~~~~~~~~~~~~
../gmp-impl.h: In function 'mpn_toom62_mul_itch':
../gmp-impl.h:5158:61: warning: operand of ?: changes signedness from 
'long int' to 'long unsigned int' due to unsignedness of other operand 
[-Wsign-compare]
    mp_size_t n = 1 + (an >= 3 * bn ? (an - 1) / (size_t) 6 : (bn - 1) 
 >> 1);
                                                              ^~~~~~~~~~~~~

... over and over due to the really strict C99 compliance request which
may or may not actually work with gcc 8.3.0 but regardless the noisey
signedness complaints seem reasonable. Then again the code may be
doing some deliberate bit shifting magic on purpose.

Of course with silly strict C99 I end up with :

libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS 
-D_TS_ERRNO -std=iso9899:1999 -m32 -g -Wall -pedantic -Wextra 
-pedantic-errors -march=i686 -mtune=i686 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin -malign-double 
-mpc80 -D_LARGEFILE64_SOURCE -c vsprintf.c -o vsprintf.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=compile /usr/bin/gcc 
-DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I.. -I/opt/bw/include 
-D_POSIX_PTHREAD_SEMANTICS -D_TS_ERRNO  -std=iso9899:1999 -m32 -g -Wall 
-pedantic -Wextra -pedantic-errors -march=i686 -mtune=i686 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin -malign-double 
-mpc80 -D_LARGEFILE64_SOURCE -c -o repl-vsnprintf.lo repl-vsnprintf.c
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS 
-D_TS_ERRNO -std=iso9899:1999 -m32 -g -Wall -pedantic -Wextra 
-pedantic-errors -march=i686 -mtune=i686 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin -malign-double 
-mpc80 -D_LARGEFILE64_SOURCE -c repl-vsnprintf.c  -fPIC -DPIC -o 
.libs/repl-vsnprintf.o
repl-vsnprintf.c:396: error: ISO C forbids an empty translation unit 
[-Wpedantic]
  #endif /* ! HAVE_VSNPRINTF */
  make[2]: *** [Makefile:435: repl-vsnprintf.lo] Error 1
make[2]: Leaving directory 
'/opt/bw/build/gmp-6.1.2_Debian_4.19.0-5-686_i686_via_eden_esther.001/printf'
make[1]: *** [Makefile:956: all-recursive] Error 1
make[1]: Leaving directory 
'/opt/bw/build/gmp-6.1.2_Debian_4.19.0-5-686_i686_via_eden_esther.001'
make: *** [Makefile:775: all] Error 2
Command exited with non-zero status 2

Where I know we have seen that before.

On other fronts has anyone messed around with gmpbench 0.2 lately?

I managed to get it to compile with some strict C99 and even on a
lowly Pentium II ( Deschutes ) machine. Just curious if anyone has taken
a glance at gmpbench in a while?



-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional


More information about the gmp-discuss mailing list