[hatari-devel] Using more GCC warnings?

Nicolas Pomarède npomarede at corp.free.fr
Fri Oct 8 23:30:20 CEST 2010


Le 08/10/2010 22:31, Eero Tamminen a écrit :
> Hi,
>
> On Sunday 19 September 2010, Eero Tamminen wrote:
>> That comes from warning -Wempty-body included into -Wextra.
>> I'm not completely sure from what kind of coding errors would
>> be indicated by an empty body which occurs in an if, else or do while
>> statement...
>>
>> If you don't think it's important, that can be disabled too:
>> 	-Wextra -Wno-unused-parameter -Wno-empty-body
>>
>> After that the current code doesn't generate extra warnings.
>
> I added extra warning options, they don't cause extra warnings
> for me.  (Tell if they give undue trouble for you and I'll remove then
> again.)
>

Hello,
I see some new warnings now (using gcc 4.5.1) :

[ 15%] Building C object src/uae-cpu/CMakeFiles/UaeCpu.dir/fpp.c.o 
 

In file included from 
/home/npomarede/src/hatari-work/src/uae-cpu/fpp.c:28:0: 

/home/npomarede/src/hatari-work/src/uae-cpu/fpp-unknown.h: In function 
'from_single':
/home/npomarede/src/hatari-work/src/uae-cpu/fpp-unknown.h:59:10: 
attention : comparer des nombres flottants à l'aide de == ou != n'est 
pas sûr
/home/npomarede/src/hatari-work/src/uae-cpu/fpp-unknown.h: In function 
'from_exten':
/home/npomarede/src/hatari-work/src/uae-cpu/fpp-unknown.h:100:13: 
attention : comparer des nombres flottants à l'aide de == ou != n'est 
pas sûr
/home/npomarede/src/hatari-work/src/uae-cpu/fpp.c: In function 'get_fpsr':
/home/npomarede/src/hatari-work/src/uae-cpu/fpp.c:74:21: attention : 
comparer des nombres flottants à l'aide de == ou != n'est pas sûr
/home/npomarede/src/hatari-work/src/uae-cpu/fpp.c: In function 'fpp_cond':
/home/npomarede/src/hatari-work/src/uae-cpu/fpp.c:515:28: attention : 
comparer des nombres flottants à l'aide de == ou != n'est pas sûr

[ 25%] Building C object src/gui-sdl/CMakeFiles/GuiSdl.dir/dlgAlert.c.o 
 

/home/npomarede/src/hatari-work/src/gui-sdl/dlgAlert.c: In function 
'DlgAlert_Notice': 

/home/npomarede/src/hatari-work/src/gui-sdl/dlgAlert.c:186:30: attention 
: operation on 'alertdlg[6].w' may be undefined

[ 38%] Building C object src/debug/CMakeFiles/Debug.dir/debugui.c.o 
 

/home/npomarede/src/hatari-work/src/debug/debugui.c: In function 
'DebugUI_SetOptions': 

/home/npomarede/src/hatari-work/src/debug/debugui.c:347:2: attention : 
new qualifiers in middle of multi-level non-const cast are unsafe

[ 41%] Building C object src/debug/CMakeFiles/Debug.dir/debugInfo.c.o 
 

/home/npomarede/src/hatari-work/src/debug/debugInfo.c: In function 
'DebugInfo_Crossbar': 

/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:21: attention 
: 'matrixDAC[0]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:21: attention 
: 'matrixDAC[1]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:21: attention 
: 'matrixDAC[2]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:21: attention 
: 'matrixDAC[3]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:7: attention : 
'matrixDMA[0]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:7: attention : 
'matrixDMA[1]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:7: attention : 
'matrixDMA[2]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:7: attention : 
'matrixDMA[3]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:35: attention 
: 'matrixDSP[0]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:35: attention 
: 'matrixDSP[1]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:35: attention 
: 'matrixDSP[2]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:35: attention 
: 'matrixDSP[3]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:49: attention 
: 'matrixEXT[0]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:49: attention 
: 'matrixEXT[1]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:49: attention 
: 'matrixEXT[2]' may be used uninitialized in this function
/home/npomarede/src/hatari-work/src/debug/debugInfo.c:255:49: attention 
: 'matrixEXT[3]' may be used uninitialized in this function

[ 70%] Building C object src/CMakeFiles/hatari.dir/main.c.o 
 

/home/npomarede/src/hatari-work/src/main.c: In function 'main': 
 

/home/npomarede/src/hatari-work/src/main.c:650:2: attention : new 
qualifiers in middle of multi-level non-const cast are unsafe


If some of these warnings are OK (I think it's the case for fpp.c for 
example), maybe we should turn them off.

Nicolas




More information about the hatari-devel mailing list