tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Many new warnings since yesterday


From: Christian Jullien
Subject: Re: [Tinycc-devel] Many new warnings since yesterday
Date: Fri, 15 Feb 2013 07:44:42 +0100

For example, this code produces different result whether it is compiled on 
Intel x86/x86_64 or ARM.
Potentially, all warnings may result to a wrong code. Did you changed recently 
a 'minor' type such as char to uint8_t or something similar?


#include <stdio.h>

int
main()
{
        char x = (char)0xff;
        unsigned char y = 'A';

        if (x > y) {
                printf(">\n");
        } else {
                printf("<=\n");
        }
        return 0;
}

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Christian Jullien
Sent: vendredi 15 février 2013 07:12
To: address@hidden
Subject: [Tinycc-devel] Many new warnings since yesterday

Yesterday, Grischka applied my patch to remove last warning (thanks Grischka), 
tcc compiled with NO warning at all.

This morning, with no changes on my config (same compiler, same options, same 
script to fetch mod and compile), I get many more warnings on RPi as well as on 
Fedora 18 x86_64

Please note that RPi uses default unsigned char which is different than x86, so 
sign warnings may be annoying

To me, a release build should be warning free. Warning free does not mean that 
build is free of ALL possible warnings (for example using extra -Wxx, using 
llvm or splint - I recommend splint) it means release manager is aware of 
suspicious code and either, by order of priority:

- fix it
- patch it in order to make build happy
- remove offending warning flag for release (and reintroduce this flag in trunk 
right after the official release)

Btw, I don't see what recent change produces those new warnings.


Here are the new warnings:

gcc -o tccpp.o -c tccpp.c -DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" 
-DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM 
-DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g 
-O2
tccpp.c: In function ‘hash_cached_include’:
tccpp.c:1251:7: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccpp.c: In function ‘next_nomacro1’:
tccpp.c:2226:13: warning: pointer targets in passing argument 2 of 
‘tok_alloc_new’ differ in signedness [-Wpointer-sign]
tccpp.c:195:18: note: expected ‘const char *’ but argument is of type ‘uint8_t 
*’
gcc -o tccgen.o -c tccgen.c -DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" 
-DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM 
-DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g 
-O2
tccgen.c: In function ‘is_compatible_func’:
tccgen.c:2113:5: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c:2113:5: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c: In function ‘parse_btype’:
tccgen.c:3057:21: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c:3059:21: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c:3060:17: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c: In function ‘decl0’:
tccgen.c:5700:22: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c:5701:25: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
tccgen.c:5705:25: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing] gcc -o tccelf.o -c tccelf.c 
-DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" 
-DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM 
-DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g 
-O2
tccelf.c: In function ‘rebuild_hash’:
tccelf.c:60:12: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:75:13: warning: pointer targets in passing argument 1 of ‘elf_hash’ 
differ in signedness [-Wpointer-sign]
tccelf.c:38:22: note: expected ‘const unsigned char *’ but argument is of type 
‘char *’
tccelf.c: In function ‘put_elf_sym’:
tccelf.c:117:13: warning: pointer targets in passing argument 1 of ‘elf_hash’ 
differ in signedness [-Wpointer-sign]
tccelf.c:38:22: note: expected ‘const unsigned char *’ but argument is of type 
‘const char *’
tccelf.c: In function ‘find_elf_sym’:
tccelf.c:147:5: warning: pointer targets in passing argument 1 of ‘elf_hash’ 
differ in signedness [-Wpointer-sign]
tccelf.c:38:22: note: expected ‘const unsigned char *’ but argument is of type 
‘const char *’
tccelf.c:151:15: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘relocate_syms’:
tccelf.c:434:18: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:438:22: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘put_got_entry’:
tccelf.c:1037:14: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘elf_output_file’:
tccelf.c:1628:30: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:1664:53: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:1694:30: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:1712:30: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:1756:34: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘tcc_load_object_file’:
tccelf.c:2432:17: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:2553:26: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:2569:14: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘tcc_load_alacarte’:
tccelf.c:2673:14: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c: In function ‘tcc_load_dll’:
tccelf.c:2810:20: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:2839:14: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccelf.c:2848:18: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign] gcc -o tccasm.o -c tccasm.c 
-DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" 
-DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM 
-DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g 
-O2 gcc -o tccrun.o -c tccrun.c -DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" 
-DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM 
-DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g 
-O2
tccrun.c: In function ‘rt_printline’:
tccrun.c:256:18: warning: pointer targets in assignment differ in signedness 
[-Wpointer-sign]
tccrun.c:349:29: warning: pointer targets in passing argument 3 of ‘pstrcpy’ 
differ in signedness [-Wpointer-sign]


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]