lmi
[Top][All Lists]
Advanced

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

Re: [lmi] wx-2.9.2 warnings


From: Vadim Zeitlin
Subject: Re: [lmi] wx-2.9.2 warnings
Date: Thu, 16 Jun 2011 17:13:25 +0200

On Wed, 15 Jun 2011 15:21:46 +0000 Greg Chicares <address@hidden> wrote:

GC> I've built this tarball:
GC>   ftp://ftp.wxwidgets.org/pub/Daily_HEAD/files/wx-all-2010-11-06.tar.gz

 Hello,

 I've just realized that I originally misread the name of this file. I
thought you were using a recent version, e.g.

ftp://ftp.wxwidgets.org/pub/Daily_HEAD/files/wxWidgets-2011-06-16.tar.gz

because I somehow managed to exchange 11 and 06 date components but this
one is rather old. If you're only starting to test with it, could it be
better to use the latest available version instead?

GC> with MinGW gcc-3.4.5, and observe the following warnings.

 FWIW almost all of them are due to -Wconversion which you used but wx
makefile don't currently use. Perhaps we should actually start using it, in
theory it could generate warnings indicating real problems (although in
practice none of the ones below fall in this category).

GC> Perhaps some of them deserve a look if they aren't already fixed in
GC> HEAD.

 They are fixed as of right now.

GC> ../src/msw/slider.cpp: In member function `virtual wxSize 
wxSlider::DoGetBestSize() const':
GC> ../src/msw/slider.cpp:679: warning: converting to `int' from `double'

 Harmless, this calculation is very approximative anyhow.

GC> ../src/msw/textctrl.cpp: In member function `virtual void 
wxTextCtrl::AppendText(const wxString&)':
GC> ../src/msw/textctrl.cpp:1198: warning: passing NULL used for non-pointer 
converting 4 of `LRESULT SendMessageW(HWND__*, UINT, WPARAM, LPARAM)'

 Harmless, LPARAM is used for both integers and pointers in MSW API.

GC> ../src/msw/uiaction.cpp: In member function `bool 
wxUIActionSimulator::MouseMove(long int, long int)':
GC> ../src/msw/uiaction.cpp:61: warning: converting to `int' from `float'
GC> ../src/msw/uiaction.cpp:62: warning: converting to `int' from `float'

 Fixed by using wxRound() instead of implicit cast to int. This might make
mouse move events generated by wxUIActionSimulator a tiny bit more precise.

GC> ../src/common/docview.cpp: In member function `virtual wxDocument* 
wxDocManager::CreateDocument(const wxString&, long int)':
GC> ../src/common/docview.cpp:1432: warning: 'docNew' might be used 
uninitialized in this function

 I believe we had already discussed this one in the past. AFAIR we never
found a solution for it though, the compiler seems to get mixed up because
of the use of try/catch here. This doesn't seem to be the case for newer
compiler versions however, e.g. 4.2 MinGW (cross-)compiler that I use
doesn't give this warning.

GC> ../src/msw/mediactrl_am.cpp: In member function `virtual wxLongLong 
wxAMMediaBackend::GetDuration()':
GC> ../src/msw/mediactrl_am.cpp:2023: warning: passing `double' for converting 
1 of `wxLongLongNative::wxLongLongNative(long long int)'

 Harmless as reasonable media durations in ms can be represented as long
long so all we can do here is to suppress the warning.

GC> ../src/richtext/richtextbuffer.cpp: In member function `virtual bool 
wxRichTextImageBlock::DoMakeImageBlock(const wxImage&, wxBitmapType)':
GC> ../src/richtext/richtextbuffer.cpp:7840: warning: converting to non-pointer 
type `bool' from NULL

 Already fixed since then.

GC> ../src/richtext/richtextctrl.cpp: In member function `virtual bool 
wxRichTextCtrl::WriteImage(const wxRichTextImageBlock&, const wxRichTextAttr&)':
GC> ../src/richtext/richtextctrl.cpp:2424: warning: passing NULL used for 
non-pointer converting 4 of `bool wxRichTextBuffer::InsertImageWithUndo(long 
int, const wxRichTextImageBlock&, wxRichTextCtrl*,
GC> int, const wxRichTextAttr&)'

 Already fixed as well.


 I've fixed several other -Wconversion warnings as well but a few more are
left. None of them look important but I'll fix them later nevertheless. In
the meanwhile, the tomorrow daily snapshot shouldn't give you any of the
ones above except for the one in docview.cpp.

 Regards,
VZ

reply via email to

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