[ratio] Test failing on trunk

Hi, Boost.ratio is failing with compiler option -pedantic Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long' Do you know a compiler macro that states if the -pedantic option is set. Otherwise I see two options: A- Don't test Boost.ratio with this option and add to the documentation the limitation. B Add a explicit macro BOOST_DONT_USE_LONG_LONG The definition of boost::intmax_t should relay on another type in this case. I think the best is option A, as Boost.Ratio could not respect the requirements if the type is not long long. What other think? Best, _____________________ Vicente Juan Botet Escribá http://viboes.blogspot.com/

On 04/01/2011 08:25, vicente.botet wrote:
Hi,
Boost.ratio is failing with compiler option -pedantic
Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long'
Shouldn't it be a warning rather than an error?

Boost.ratio is failing with compiler option -pedantic
Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long'
Shouldn't it be a warning rather than an error?
It's a hard error with -pedantic unless you use -Wno-long-long. You can also use boost::long_long_type and boost::ulong_long_type (defined in config.hpp) to avoid this issue. HTH, John.

John Maddock-3 wrote:
Boost.ratio is failing with compiler option -pedantic
Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long'
Shouldn't it be a warning rather than an error?
It's a hard error with -pedantic unless you use -Wno-long-long.
You can also use boost::long_long_type and boost::ulong_long_type (defined in config.hpp) to avoid this issue.
HTH, John.
I'm using boost::intmax_t and the command included -Wno-long-long. Would boost::long_long_type work better? Best, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/ratio-Test-failing-on-trunk-tp3173130p317... Sent from the Boost - Dev mailing list archive at Nabble.com.

Vicente Botet wrote:
John Maddock-3 wrote:
Boost.ratio is failing with compiler option -pedantic
Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long'
Shouldn't it be a warning rather than an error?
It's a hard error with -pedantic unless you use -Wno-long-long.
You can also use boost::long_long_type and boost::ulong_long_type (defined in config.hpp) to avoid this issue.
I'm using boost::intmax_t and the command included -Wno-long-long.
Would boost::long_long_type work better?
Hrr. I was wrong. I added <toolset>gcc:<cxxflags>-Wno-long-long but I guess that I need also <toolset>darwin:<cxxflags>-Wno-long-long Thanks, I will try this. Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/ratio-Test-failing-on-trunk-tp3173130p317... Sent from the Boost - Dev mailing list archive at Nabble.com.

I'm using boost::intmax_t and the command included -Wno-long-long.
Would boost::long_long_type work better?
Ah, if you really need intmax_t then you should use it, just in case it's longer than a long long (unlikely, but you never know). The trouble is, boost::intmax_t may just be a synonym for std::intmax_t which may or may not have the warning suppressed :-( So maybe -Wno-long-long (on Darwin as well as GCC) may be the correct approach... John.

----- Original Message ----- From: "John Maddock" <boost.regex@virgin.net> To: <boost@lists.boost.org> Sent: Tuesday, January 04, 2011 6:27 PM Subject: Re: [boost] [ratio] Test failing on trunk
I'm using boost::intmax_t and the command included -Wno-long-long.
Would boost::long_long_type work better?
Ah, if you really need intmax_t then you should use it, just in case it's longer than a long long (unlikely, but you never know). The trouble is, boost::intmax_t may just be a synonym for std::intmax_t which may or may not have the warning suppressed :-(
So maybe -Wno-long-long (on Darwin as well as GCC) may be the correct approach...
It works on gcc with <toolset>gcc:<cxxflags>-Wextra <toolset>gcc:<cxxflags>-Wno-long-long <toolset>gcc:<cxxflags>-pedantic So I will give a try to <toolset>darwin:<cxxflags>-Wextra <toolset>darwin:<cxxflags>-Wno-long-long <toolset>darwin:<cxxflags>-pedantic Thanks, Vicente

On 1:59 PM, vicente.botet wrote:
Hi,
Boost.ratio is failing with compiler option -pedantic
Test output: Sandia-darwin-4.0.1 - ratio - ratio_pass / darwin-4.0.1 Rev 67644 / Tue, 4 Jan 2011 01:50:26 +0000 ... ../libs/ratio/test/ratio_ratio/ratio_pass.cpp:24: error: ISO C++ does not support 'long long'
I just got this warning in some code, switched from 'unsigned long long' to uint64_t (I think) and it went away. Didn't look any closer, but there's some magic in some header that gets around it (on some platforms?). HTH.
participants (5)
-
Jim Bell
-
John Maddock
-
Mathias Gaunard
-
Vicente Botet
-
vicente.botet