byzhang / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

Compilation error in documet.h with GCC 4.2 #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I try compile with GCC 4.2 on MacOS and I got error:
integer constant is to large for 'long' type

in this code:

    //! Constructor for uint64_t value.
    GenericValue(uint64_t u64) : flags_(kNumberUint64Flag) {
        data_.n.u64 = u64;
        if (!(u64 & 0x8000000000000000L))
            flags_ |= kInt64Flag;
        if (!(u64 & 0xFFFFFFFF00000000L))
            flags_ |= kUintFlag;
        if (!(u64 & 0xFFFFFFFF80000000L))
            flags_ |= kIntFlag;
    }

Original issue reported on code.google.com by archj...@gmail.com on 25 Jan 2012 at 5:25

GoogleCodeExporter commented 9 years ago
I do not have such environment to reproduce the problem. Can you help checking 
whether ULL suffix able to solve the issue?

        if (!(u64 & 0x8000000000000000ULL))
            flags_ |= kInt64Flag;
        if (!(u64 & 0xFFFFFFFF00000000ULL))
            flags_ |= kUintFlag;
        if (!(u64 & 0xFFFFFFFF80000000ULL))
            flags_ |= kIntFlag;

Original comment by milo...@gmail.com on 31 Jan 2012 at 3:50

GoogleCodeExporter commented 9 years ago
I temporarily solved it with LL suffix, but I also will check it with ULL.
I work on MacOs from time to time, therefore this it will not be very soon.

Original comment by archj...@gmail.com on 1 Feb 2012 at 8:43

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r54.

Original comment by milo...@gmail.com on 19 Feb 2012 at 2:39