Help replacing ULL to eliminate pedantic error that ULL is C99

Stephen Torri storri@torri.org
Thu Apr 5 14:07:00 GMT 2007


I have a c++ program that has some 64-bit constants. How can I replace
ULL in my code so that I can tell g++ that the constants are 64-bits
long when I use the -ansi -pedantic flags?

    inline void
    Byte_Converter::convert (boost::uint64_t& input) {
        boost::uint64_t output = (input << 56) |
            ((input << 40) & 0x00ff000000000000ULL) |
            ((input << 24) & 0x0000ff0000000000ULL) |
            ((input << 8)  & 0x000000ff00000000ULL) |
            ((input >> 8)  & 0x00000000ff000000ULL) |
            ((input >> 24) & 0x0000000000ff0000ULL) |
            ((input >> 40) & 0x000000000000ff00ULL) |
            ((input >> 56) & 0x00000000000000ffULL);
        input = output;
    }	


Stephen



More information about the Gcc-help mailing list