On 25/05/17 12:19 +0100, Jonathan Wakely wrote:
On 25/05/17 06:54 -0400, Nathan Sidwell wrote:
On 05/25/2017 01:29 AM, Richard Biener wrote:
On May 25, 2017 3:22:18 AM GMT+02:00, Nathan Sidwell <nat...@acm.org> wrote:
On 05/24/2017 09:13 PM, Nathan Sidwell wrote:
On 05/24/2017 08:56 PM, Nathan Sidwell wrote:
On 05/24/2017 08:34 PM, Nathan Sidwell wrote:
We now warn on casts to T const.  Applied as obvious to fix
bootstrap.

And this fixes c-common.c

And fix auto-profile.c

and lto-streamer-out.c, sigh

What's the reason to warn here?!

It's a new warning about trying to cast to a const T because the const is ignored.

It might be better if the warning only triggered on trying to cast 'T' to 'const T' and not trigger casting 'U' to 'const T'? I dunno.

Maybe, although the language is clear that casting to (const T) means
exactly the same as casting to (T) when T is a scalar type. What
benefit is there to saying (const T) if the compiler ignores the
const?  (which the standard says it should, and I implemented in
r248432).

I don't mind removing the warning again if preferred. I thought it was
useful (as we already warn for ignored const in return types).

All I really care about is that the compiler ignores the const, if it
does that without warning that's OK.


Reply via email to