[wx-dev] [CVS HEAD] Compile error in include/wx/datetime.h

Wlodek Szafran wlodek.szafran at hwcn.org
Mon Apr 2 20:18:55 PDT 2007


On 04/02/2007 6:20 PM, Vaclav Slavik wrote:
> Wlodek Szafran wrote:
>> Actually, with MinGW 3.4.5, I'm getting the erroneous result as
>> well:
> 
> Are you sure that you didn't mix its files with some other version? 

Quite sure, it's built from the patched sources available from the MinGW 
site.

> Because I removed MinGW and reinstalled it from scratch just to be 
> sure, and I still don't get this error with the latest MinGW release:
>     binutils-2.17.50-20060824-1.tar.tar
>     gcc-core-3.4.5-20060117-1.tar.gz
>     gcc-g++-3.4.5-20060117-1.tar.tar
>     mingw-runtime-3.12.tar.gz
>     w32api-3.9.tar.gz
> I don't see how could this happen when MinGW doesn't have external 
> dependencies that could be different in our cases.

The only differences I can think of now are that I'm using newer 
binutils, but that shouldn't matter at all and that mine is actually a 
cross-toolchain hosted on Cygwin, which again shouldn't matter as the 
type definitions used are those of the target system.

> And the two other reports were about gcc 4.1 without mingw patches. I 
> can see the bug myself with that, but for all I know, it may be 
> completely broken compiler with mingw patches not applied.

It's not that bad, there are indeed certain target-specific issues, but 
reading and analyzing source code is not one of them.

>> due to wint_t and wxDateTime_t both being typed as short unsigned
>> int. 
> 
> Yes, that appears to be the case, but for mingw-gcc *3.4*. wint_t is a 
> distinct type in 4.1. In other words, gcc-3.4 would be justified in 
> failing to compile this, but it works, while gcc-4.1 should work just 
> fine, but fails. I'm completely confused uby this :(

It appears to me that in this case the compiler must be seeing two 
overloads that look the same, possibly after type promotions, and it 
can't decide which one to use for the comparison.

FWIW, the downloaded pre-built MinGW 3.4.5 compiler as well as the one I 
built myself from sources, both define __WINT_TYPE__ (thus wint_t) as 
"short unsigned int".

Just curious, what do your MinGW compilers define __WINT_TYPE__ as?  You 
can check that by running:

g++ -dM -E -xc somefile.cpp

Best regards.

-- 
Wlodek Szafran




More information about the wx-dev mailing list