chrono.cc build failure in maintainer-mode

View: New views
4 Messages — Rating Filter:   Alert me  

chrono.cc build failure in maintainer-mode

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm getting a build failure with --enable-maintainer-mode (which turns
on -Werror) on trunk:

cc1plus: warnings being treated as errors
../../../../gcc/libstdc++-v3/src/chrono.cc: In static member function ‘static std::chrono::system_clock::time_point std::chrono::system_clock::now()’:
../../../../gcc/libstdc++-v3/src/chrono.cc:56:40: error: suggest parentheses around ‘&&’ within ‘||’

Aside, it seems weird that the compiler refers to && and || which do not
occur in chrono.cc.  Wrong error location?

Should I open a PR?

Thanks,
Ralf

Re: chrono.cc build failure in maintainer-mode

by Chris Fairles :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could be duration ctor enableif's (from the seconds/milliseconds on
that line)? They have parentheses already however (chrono header line
214-226 ish).

Chris

On Tue, Nov 3, 2009 at 1:18 AM, Ralf Wildenhues <Ralf.Wildenhues@...> wrote:

> I'm getting a build failure with --enable-maintainer-mode (which turns
> on -Werror) on trunk:
>
> cc1plus: warnings being treated as errors
> ../../../../gcc/libstdc++-v3/src/chrono.cc: In static member function ‘static std::chrono::system_clock::time_point std::chrono::system_clock::now()’:
> ../../../../gcc/libstdc++-v3/src/chrono.cc:56:40: error: suggest parentheses around ‘&&’ within ‘||’
>
> Aside, it seems weird that the compiler refers to && and || which do not
> occur in chrono.cc.  Wrong error location?
>
> Should I open a PR?
>
> Thanks,
> Ralf
>

Re: chrono.cc build failure in maintainer-mode

by Paolo Carlini-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ralf Wildenhues wrote:
> Aside, it seems weird that the compiler refers to && and || which do not
> occur in chrono.cc.  Wrong error location?
>
> Should I open a PR?
>  
I think you should, but the warning is doubly bogus, first because the
location is totally wrong, second because it's actually triggered by
this conditional inside an enable_if, which is fine and cannot be
"fixed" in any way:

           enable_if<treat_as_floating_point<rep>::value
             || (ratio_divide<_Period2, period>::type::den == 1
                 && !treat_as_floating_point<_Rep2>::value)>::type>
 
You can also guess it's bogus because it happens only for -fpic.

Thus, I say, please file a PR but a diagnostic one, **not** a library one.

Paolo.

Re: chrono.cc build failure in maintainer-mode

by Paolo Carlini-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paolo Carlini wrote:
> Thus, I say, please file a PR but a diagnostic one, **not** a library one.
>  
I went ahead and filed c++/41927.

Paolo.