Opened 15 years ago

Closed 15 years ago

#1503 closed Bugs (fixed)

typeof bug (big integral constant)

Reported by: Viper Craft Owned by: Peder Holt
Milestone: Component: typeof
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

Following small piece of code demonstrate problem:

#include <boost/typeof/typeof.hpp>

int main()
{
    const BOOST_AUTO(uid_mask,        0xFFFFFFFFFFL); // # sutation 1
    const BOOST_AUTO(type_id_mask,    0xFFFF);
    const BOOST_AUTO(res_id_mask,     0xFF);

    return 0;
}

BOOST_AUTO macro produce wrong type 'long', but in situation # 1, it shall produce 'long long' type instead.

Change History (2)

in reply to:  description comment:1 by sk@…, 15 years ago

Replying to Viper Craft:

Following small piece of code demonstrate problem:

#include <boost/typeof/typeof.hpp>

int main()
{
    const BOOST_AUTO(uid_mask,        0xFFFFFFFFFFL); // # sutation 1
    const BOOST_AUTO(type_id_mask,    0xFFFF);
    const BOOST_AUTO(res_id_mask,     0xFF);

    return 0;
}

BOOST_AUTO macro produce wrong type 'long', but in situation # 1, it shall produce 'long long' type instead.

Resolved, g++ accept LL postfix for 'long long' types.

comment:2 by Peder Holt, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in user code.

Note: See TracTickets for help on using tickets.