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

Dennis Clarke dclarke at blastwave.org
Mon Jul 1 16:11:35 UTC 2019


On 7/1/19 8:09 AM, Vincent Lefevre wrote:
> On 2019-06-29 20:32:07 -0400, Dennis Clarke wrote:
>> Of course with silly strict C99 I end up with :
>>
.
.
.
>> Where I know we have seen that before.
> 
> 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.
> 

That is precisely all I did to printf/repl-vsnprintf.c was to toss in
the typedef on the last line and the complaint went away.

Also saw this on Debian sid for uname -m being "armv7l" and :

arm7$ head /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 48.00
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc0d
CPU revision    : 1

arm7$ uname -a
Linux arm7 4.4.132+ #1 SMP Tue Oct 23 18:03:49 CST 2018 armv7l GNU/Linux
arm7$ cat /etc/debian_version
buster/sid

Everything compiles, tests and seems to run just fine there after the
empty typedef is tossed in.


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


More information about the gmp-discuss mailing list