Opened 9 years ago

Closed 9 years ago

#9061 closed Bugs (fixed)

Incorrect usage of `long long` in Boost.Intrusive

Reported by: Antony Polukhin Owned by: Ion Gaztañaga
Milestone: Boost 1.55.0 Component: intrusive
Version: Boost 1.54.0 Severity: Regression
Keywords: long long intrusive containers Cc:

Description

boost/intrusive/detail/utilities.hpp uses long long even on C++03/C++98 compilers, which do not have support that type:

In file included from ../boost/intrusive/slist_hook.hpp:19,
                 from ../boost/intrusive/slist.hpp:21,
                 from ../boost/container/detail/multiallocation_chain.hpp:19,
                 from ../boost/container/detail/allocator_version_traits.hpp:22,
                 from ../boost/container/string.hpp:48,
                 from ../libs/conversion/test/lexical_cast_containers_test.cpp:13:
../boost/intrusive/detail/utilities.hpp:435:41: warning: use of C99 long long integer constant
In file included from ../boost/container/detail/utilities.hpp:28,
                 from ../boost/container/string.hpp:42,
                 from ../libs/conversion/test/lexical_cast_containers_test.cpp:13:
../boost/container/detail/type_traits.hpp:73: error: ISO C++ does not support 'long long'
In file included from ../boost/intrusive/slist_hook.hpp:19,
                 from ../boost/intrusive/slist.hpp:21,
                 from ../boost/container/detail/multiallocation_chain.hpp:19,
                 from ../boost/container/detail/allocator_version_traits.hpp:22,
                 from ../boost/container/string.hpp:48,
                 from ../libs/conversion/test/lexical_cast_containers_test.cpp:13:
../boost/intrusive/detail/utilities.hpp:562: error: ISO C++ does not support 'long long'

Change History (3)

comment:1 by Ion Gaztañaga, 9 years ago

Those uses are protected with BOOST_HAS_LONG_LONG, so I don't understand why is this macro active when compiling in strict ISO 98 mode. Maybe you are activating some -Wno-long-long and compiling warnings as errors? I don't think there is a fix for this, unless boost/config is modified to detect long long warning as error was activated by command line.

in reply to:  1 comment:2 by Antony Polukhin, 9 years ago

Replying to igaztanaga:

Maybe you are activating some -Wno-long-long and compiling warnings as errors?

You're right. I've become over pedantic and compiled code with -Wlong-long

comment:3 by Antony Polukhin, 9 years ago

Resolution: fixed
Status: newclosed

(In [85684]) Do not treat long long warnings as errors in lexical_cast + containers tests (fixes #9061)

Note: See TracTickets for help on using tickets.