Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
I have a perefectly building & running wxWidgets based application. However, for almost every module I compile, I get the following warning message (which quite frankly has become annoying):
c:\wxWidgets-2.6.3\include\wx/longlong.h(169) : warning C4244: 'return' : conversion from 'const __int64' to 'double', possible loss of data
Is there a way to get rid of it without lowering warning level?
Thanks,
Dave
P.S. wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5
tiwag wrote:looks like you have enabled 64bit support
Huh???
I am using a 32-bit platform, so I have no idea what you mean by "enabled 64bit support". The only place in setup.h where "64" is mentioned is in reference to wxUSE_LONGLONG. Is that what you meant?
tiwag wrote:ldo you need that ?
I certainly don't need that, but the wxUSE_LONGLONG documentation says:
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
And I do intend to use wxDateTime, so I just left it at the default (recommended) setting.
Thanks,
Dave
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2
(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
tiwag wrote:looks like you have enabled 64bit support
Huh???
I am using a 32-bit platform, so I have no idea what you mean by "enabled 64bit support"...
i meant the other way round, in your compiler settings
newer compilers have special support for 64bit , if you enable these features,
maybe any macro get's defined, which then uses long long 's where in a 32bit build it would use long's .
edit: i just now have read from your sig, that you use VC6
this could be the problem, post a small sample which shows your
problem, and we can help you, at least we can find out if it is a compiler problem or if you've screwed your wx-build
i meant the other way round, in your compiler settings
I am afraid that I don't understand: How do I enable 64-bit support in my compiler settings (I am using Visual C++ 6.0)?
Also, the warning I am getting is not for a particular snippet of code that I am using, but rather for all and any modules (that include the wx headers) that I compile. It always points to line 169 in longlong.h which reads:
#if wxABI_VERSION >= 20602
// convert to double
double ToDouble() const { return m_ll; }
#endif // ABI >= 2.6.2
Any idea what's happening?
Thanks,
Dave
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2
(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
tiwag wrote:but I find it interesting, why he DOES get the warning, that's not normal i guess.
tiwag, I finally got around to trying your code snippet (as you posted above). Here are the results:
--------------------Configuration: console - Win32 DLL Unicode Debug--------------------
Compiling...
console.cpp
c:\wxWidgets-2.6.3\include\wx/longlong.h(169) : warning C4244: 'return' : conversion from 'const __int64' to 'double', possible loss of data
D:\tmp\console\console.cpp(4) : warning C4100: 'argv' : unreferenced formal parameter
D:\tmp\console\console.cpp(4) : warning C4100: 'argc' : unreferenced formal parameter
Linking...
console.exe - 0 error(s), 3 warning(s)
I hope you can shed some light on the mystery, since I myself have no clue why this warning.
Before trying to modify wxWidgets sources I would like to understand where it comes from, since in a previous W2K/VC6 wxWidgets-based development environment I don't remember having this warning.
Thanks,
Dave
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2
(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
a) the warning itself is justified, conversion from 64bit integer to double can lose data
b) the wxABI_VERSION macro and wxLongLong::ToDouble() were both introduced in wx 2.6.2, that's probably the reason why you didn't see the warning before
c) in wx 2.7.x the code line looks different already and without the wxABI_VERSION check:
I hope this will shed some light on the mystery. I haven't read doublemax's reply thoroughly yet, but I have a feeling that he provides a satisfactory explanation. I will need to examine it and see if I understand what it means.
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2
(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
doublemax wrote:a) the warning itself is justified, conversion from 64bit integer to double can lose data
b) the wxABI_VERSION macro and wxLongLong::ToDouble() were both introduced in wx 2.6.2, that's probably the reason why you didn't see the warning before
c) in wx 2.7.x the code line looks different already and without the wxABI_VERSION check.
doublemax, thank you very much! I just did what you suggested (with a slight modification): I replaced line 169 in longlong.h:
davebee wrote:
I consider this issue a "slight bug" in wx 2.6.3.
your compiler is right with this warning, it depends on the warning-level.
check your documentation of VC6 about all the switches and i'm shure,
that there is one, which controls the behaviour.
since i'm working with gcc, i'm not familiar with the M$ compilers and
don't know all the switches. but i'm curious why gcc doesn't emit such a warning ...