[ratio] Test failing on trunk

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[ratio] Test failing on trunk

Vicente Botet
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/
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

Mathias Gaunard-2
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?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

John Maddock-3
>> 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.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

Jim Bell
In reply to this post by Vicente Botet


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.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

Vicente Botet
In reply to this post by John Maddock-3
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
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

Vicente Botet
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
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

John Maddock-3
In reply to this post by Vicente Botet
> 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.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [ratio] Test failing on trunk

Vicente Botet
----- Original Message -----
From: "John Maddock" <[hidden email]>
To: <[hidden email]>
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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost