[fdo-users] Re: Compilation on 64-bit linux

Robin Newton robin.newton at 1spatial.com
Tue May 17 12:37:45 EDT 2011

I've only recently thought to try running the core FDO unit tests, and now
that I have I've noticed a couple of failures:
ExpressionTest.testDataValueConvert and SchemaTest.testDataConstraints. In
both cases it appears to be due to an assumption that LONG_MIN and LONG_MAX
are 32-bit integers. With the latter test failure, the assumption is being
made in the test itself. The former failure is more worrying, as the problem
looks to be in the source code proper.

In Fdo/Unmanaged/Src/Fdo/Expression/Int32Value.cpp there are a number of
calls to Convert that pass LONG_MIN and LONG_MAX as the upper and lower
limits for conversion. On a platform where longs are 64 bit, these values
are truncated to 0 and -1, and a conversion will fail if it is not within
these limits. Hence the test failure.

(I've also been caught out by the call to sscanf in
Fdo/Unmanaged/Src/Fdo/ClientServices/prefix.cpp assuming that ints and longs
are the same size.)

So, when people have been able to compile on 64-bit Linux, have they been
getting these failures and ignoring them? Or is there some variation
(between distributions?) in the sizes of ints and longs, such that they
haven't been affected by this?


View this message in context: http://osgeo-org.1803224.n2.nabble.com/Compilation-on-64-bit-linux-tp6261771p6373800.html
Sent from the FDO Users mailing list archive at Nabble.com.

More information about the fdo-users mailing list