axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <>
Subject Re: Error with MaxInclusive
Date Tue, 25 Jan 2005 02:36:37 GMT
Further to the platform specific nature of the max/min values

printf ("%lld\n", LONG_LONG_MIN);
printf ("%lld\n", LONG_LONG_MAX);



The value in the code (18446744073709551615) is double the max value
that my machine can handle.

I think rahter than using the platform specific headers we can use
these constant variable names (such as LONG_LONG_MAX) in the code in
place of the hard coded vales. These constants are defined in the
limits header. (#include <limits>)


On Tue, 25 Jan 2005 02:16:20 +0000, Samisa Abeysinghe
<> wrote:
> Hi Adrian,
>     I get the following error when I try to build the latest CVS on my system:
> src/soap/xsd/UnsignedLong.cpp:47: error: integer
>        [cc]    constant is too large for "long" type
> Looking into the source I see the line
> return new MaxInclusive((LONGLONG) 18446744073709551615);
> I was wondering if the error is due to that the given Max Size is
> platform dependent. (In other words, type longlong cannot deal with
> such a large number on my system.)
> I assume this becase, in C++, the range of values that a given basic
> type can handle is platform (or machine) specific.
> If this is the case, I propose that we move these values to platform
> specific headers and define them as constants and use those in these
> XSD classes.
> [
> FYI:
> on my system:
> printf ("%ld\n", LONG_MIN);
> printf ("%ld\n", LONG_MAX);
> gives out:
> -2147483648
>  2147483647
> ]
> Thoughts please.
> Thanks,
> Samisa...

View raw message