public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: Richard Biener <richard.guenther@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [libibery PATCH] Fix bootstrap
Date: Thu, 25 May 2017 11:22:00 -0000	[thread overview]
Message-ID: <20170525112153.GW12306@redhat.com> (raw)
In-Reply-To: <20170525111953.GV12306@redhat.com>

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 <nathan@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	other threads:[~2017-05-25 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25  0:56 Nathan Sidwell
2017-05-25  1:13 ` Nathan Sidwell
2017-05-25  1:22   ` Nathan Sidwell
2017-05-25  1:42     ` Nathan Sidwell
2017-05-25  6:25       ` Richard Biener
2017-05-25 10:58         ` Nathan Sidwell
2017-05-25 11:21           ` Jonathan Wakely
2017-05-25 11:22             ` Jonathan Wakely [this message]
2017-05-25 12:35               ` Nathan Sidwell
2017-05-25 13:01                 ` Richard Biener
2017-05-25 13:03                   ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170525112153.GW12306@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).