openMSX / wxcatapult

23 stars 4 forks source link

[Bug] wxCatapult: Fix warnings + the issues reported in e-mails entitled "code analysis complete - could be some false positives" [sf#483] #16

Open openMSX-import opened 9 years ago

openMSX-import commented 9 years ago

Reported by joxy on 2013-07-30 03:54 UTC

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 08:01 UTC

C6011 Dereferencing null pointer Dereferencing NULL pointer 'm_str'.

Line 127: 'm_str' may be NULL
Line 127: 'm_str' is dereferenced, but may still be NULL

wxCatapult - buffer.h (Line 127)

not fixed, where is this?

C6011 Dereferencing null pointer Dereferencing NULL pointer 'm_str'.

Line 134: 'm_str' may be NULL
Line 134: 'm_str' is dereferenced, but may still be NULL

wxCatapult - buffer.h (Line 134)

not fixed, where is this?

C28251 Inconsistent annotation for function: this instance has an error

Inconsistent annotation for 'WinMain': this instance has no annotations. See c:\program files (x86)\windows kits\8.0\include\um\winbase.h(2188). wxCatapult - wxcatapultapp.cpp (Line 28)

not fixed, what is this about?

all other was fixed

tested slightly on linux (not paying attn to what was fixed, as these probably don't trigger)

test on vc32 and mingw32 pending

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 08:04 UTC x64 warnings not yet fixed

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 09:10 UTC Until these three warnings ([1]) are understood by someone, I mark these 3 warnings as "undecipherable" and "closed-invalid".

[1] https://sourceforge.net/p/openmsx/bugs/483/#2527 (the comment above)

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 09:53 UTC mingw32 warnings:

Compiling VideoControlPage...
src/VideoControlPage.cpp: In member function 'void VideoControlPage::OnChangeBlu
r(wxScrollEvent&)':
src/VideoControlPage.cpp:181:57: warning: format '%ld' expects argument of type
'long int', but argument 2 has type 'int' [-Wformat]
src/VideoControlPage.cpp: In member function 'void VideoControlPage::OnChangeGlo
w(wxScrollEvent&)':
src/VideoControlPage.cpp:188:57: warning: format '%ld' expects argument of type
'long int', but argument 2 has type 'int' [-Wformat]
src/VideoControlPage.cpp: In member function 'void VideoControlPage::OnChangeSca
nlines(wxScrollEvent&)':
src/VideoControlPage.cpp:202:57: warning: format '%ld' expects argument of type
'long int', but argument 2 has type 'int' [-Wformat]
Compiling AudioControlPage...
Compiling MiscControlPage...
src/MiscControlPage.cpp: In member function 'void MiscControlPage::OnSpeedChange
(wxScrollEvent&)':
src/MiscControlPage.cpp:178:62: warning: format '%ld' expects argument of type '
long int', but argument 2 has type 'int' [-Wformat]
src/MiscControlPage.cpp: In member function 'void MiscControlPage::OnMaxFrameSki
pChange(wxScrollEvent&)':
src/MiscControlPage.cpp:209:61: warning: format '%ld' expects argument of type '
long int', but argument 2 has type 'int' [-Wformat]
src/MiscControlPage.cpp: In member function 'void MiscControlPage::OnMinFrameSki
pChange(wxScrollEvent&)':
src/MiscControlPage.cpp:216:61: warning: format '%ld' expects argument of type '
long int', but argument 2 has type 'int' [-Wformat]
src/MiscControlPage.cpp: In member function 'void MiscControlPage::OnChangeRenSh
aTurbo(wxScrollEvent&)':
src/MiscControlPage.cpp:542:45: warning: format '%ld' expects argument of type '
long int', but argument 2 has type 'int' [-Wformat]
openMSX-import commented 9 years ago

Updated by joxy on 2013-08-02 09:58 UTC

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 10:23 UTC tested slightly on mingw32, all ok for now.

openMSX-import commented 9 years ago

Commented by m9710797 on 2013-08-02 10:26 UTC I'm not sure why you put these mingw32 warnings in this bug report (seems a completely different issue to me). But the problem there is a mismatch between the "%ld" format specifier (stands for print long-decimal). And the type of the actually passed argument (getInt() returns a 'int'). The fix is to change the format specifier to "%d" (this prints normal ints).

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-04 07:41 UTC

  1. Wouter: I collect all warnings here, regardless of their nature.
  2. Vampier wrote: btw buffer.h c:\compiler\openmsx-wxcatapult\derived\3rdparty\src\wxmsw-2.8.12\include\wx\buffer.h
openMSX-import commented 9 years ago

Commented by joxy on 2013-08-04 07:42 UTC Regarding buffer.h:

(16:32:18) egp: this should be submitted to wxWidgets bug tracker (16:35:28) Vampier: then wxwidgets tells us to use the latest version (16:35:29) Vampier: :) (16:36:36) egp: they should fix it in a stable version (16:36:47) egp: in a 2.8.x branch (16:37:37) egp: I am not gonna use the development version of wx (2.9.x)