public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: Marek Polacek <polacek@redhat.com>,
	 "gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: Drop -Wswitch-bool warning in function.c
Date: Thu, 09 Jul 2015 06:55:00 -0000	[thread overview]
Message-ID: <87vbdtkefr.fsf@e105548-lin.cambridge.arm.com> (raw)
In-Reply-To: <CA+yXCZCPn0bbfYz2_V4Atzi+6PrgoBJ6YWb4x3hOcRQJ_M36xQ@mail.gmail.com>	(Kito Cheng's message of "Thu, 9 Jul 2015 00:12:56 +0800")

Kito Cheng <kito.cheng@gmail.com> writes:
> Yes, I know it's non-fatal warning, but I think gcc should build with
> --enable-werror-always by it's self
> and it's the *ONLY* warning in trunk now.

Yeah, but it should only build with --enable-werror-always if your host
compiler is the same version as the one you're building.  It would be too
much to expect it to compile cleanly with older versions too, since there's
no obvious place to draw the line.

So Marek's point was that current GCC (deliberately) does not warn about
this switch statement.  The switch statement used to be:

  /* Allow the target to compare Y with X without leaking either into
     a register.  */
  switch ((int) (HAVE_stack_protect_test != 0))

but the (int) cast was removed at the same time as the warning was
adjusted:

  https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00790.html

(BTW, although you cc:ed me, it was that patch rather than mine that
introduced the warnings when using unpatched host compilers.)

Thanks,
Richard

  reply	other threads:[~2015-07-09  6:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  8:49 Kito Cheng
2015-07-08 13:30 ` Marek Polacek
2015-07-08 16:13   ` Kito Cheng
2015-07-09  6:55     ` Richard Sandiford [this message]
2015-07-08 21:00 ` Jeff Law
2015-07-09  3:26   ` Kito Cheng
2015-07-09  3:51     ` Jeff Law

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=87vbdtkefr.fsf@e105548-lin.cambridge.arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@gmail.com \
    --cc=polacek@redhat.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).