You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Adrian Dick <ad...@uk.ibm.com> on 2005/01/25 12:45:24 UTC
: Error with MaxInclusive
Hi Guys,
Apologies for breaking your builds. I have made some modifications to the
problem code which now compiles and runs successfully on Windows, Linux (RH
AS 3.0) and AIX.
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)
Samisa Abeysinghe <sa...@gmail.com> wrote on 25/01/2005
09:10:58:
> An *ugly* hack.
> Till this is fixed, I used smaller arbitrary values in those locations
> of code where the error is given. Works for now. But hope that Adrian
> is looking into this and would fix soon.
>
> Thanks,
> Samisa...
>
>
> On Tue, 25 Jan 2005 15:03:56 +0600, Nithyakala Thangaraja
> <ni...@opensource.lk> wrote:
> >
> > Hi,
> >
> > Current cvs checkout does not build on linux , due to following errors
> >
> > xsd/Long.cpp:12: warning: this decimal constant is unsigned only in ISO
C90
> > xsd/Long.cpp:12: error: integer constant is too large for "long" type
> > xsd/Long.cpp:17:52: warning: integer constant is so large that it
> is unsigned
> > xsd/Long.cpp: In member function `virtual axiscpp::MinExclusive*
> > axiscpp::Long::getMinExclusive()':
> > xsd/Long.cpp:17: warning: this decimal constant is unsigned only in ISO
C90
> > xsd/Long.cpp:17: error: integer constant is too large for "long" type
> > xsd/Long.cpp: In member function `virtual axiscpp::MaxInclusive*
> > axiscpp::Long::getMaxInclusive()':
> > xsd/Long.cpp:22: error: integer constant is too large for "long" type
> > xsd/Long.cpp:27:51: warning: integer constant is so large that it
> is unsigned
> > xsd/Long.cpp: In member function `virtual axiscpp::MaxExclusive*
> > axiscpp::Long::getMaxExclusive()':
> > xsd/Long.cpp:27: warning: this decimal constant is unsigned only in ISO
C90
> > xsd/Long.cpp:27: error: integer constant is too large for "long" type
> > make: *** [Long.lo] Error 1
> >
> > Regards,
> > Nithya
> >
> > On Tue, 25 Jan 2005 08:19:37 +0000, Samisa Abeysinghe wrote
> > > Adrian,
> > > Windows too seem to suppport some of these limit constants
> in LIMITS.H.
> > >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/vclang/html/_pluslang_c.2b2b_.integer_limits.asp
> > > However, LONG_LONG_INT is missing here.
> > > May be these constants too are not that portable :-(
> > > Thanks,
> > > Samisa...
> > >
> > > On Tue, 25 Jan 2005 08:09:55 +0000, Adrian Dick
> > > <ad...@uk.ibm.com> wrote:
> > > >
> > > >
> > > > Samisa,
> > > >
> > > > Ah, yes! This is because we need to use an unsigned long long, for
this
> > > > datatype (is there such a thing?) . Obviously VC++ guessed this,
so I
> > > > didn't notice the problem before I committed it yesterday.
> > > >
> > > > I shall get on to this immediately.
> > > >
> > > > Adrian
> > > > _______________________________________
> > > > Adrian Dick (adrian.dick@uk.ibm.com)
> > > >
> > > > Samisa Abeysinghe <sa...@gmail.com> wrote on 25/01/2005
> > > > 02:36:37:
> > > >
> > > > > Further to the platform specific nature of the max/min values
> > > > >
> > > > > printf ("%lld\n", LONG_LONG_MIN);
> > > > > printf ("%lld\n", LONG_LONG_MAX);
> > > > >
> > > > > yeilds
> > > > >
> > > > > -9223372036854775808
> > > > > 9223372036854775807
> > > > >
> > > > > 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>)
> > > > >
> > > > > Thanks,
> > > > > Samisa...
> > > > >
> > > > >
> > > > > On Tue, 25 Jan 2005 02:16:20 +0000, Samisa Abeysinghe
> > > > > <sa...@gmail.com> 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...
> > > > > >
> > > >
> > > >
> >
> >
> > --
> > Lanka Software Foundation (http://www.opensource.lk)
> >
> >