public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none
Date: Fri, 05 Apr 2024 16:09:33 +0000	[thread overview]
Message-ID: <bug-114606-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606

            Bug ID: 114606
           Summary: -Whardened doesn't trigger with -fcf-protection=none
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

-Whardened warns when -fhardened couldn't enable a hardening option because
that option was disabled on the command line, e.g.:

$ ./cc1plus -quiet g.C  -fhardened -O2 -fstack-protector
cc1plus: warning: ‘-fstack-protector-strong’ is not enabled by ‘-fhardened’
because it was specified on the command line [-Whardened]

but it doesn't work as expected with -fcf-protection=none:

$ ./cc1plus -quiet g.C  -fhardened -O2 -fcf-protection=none
# should warn

because we're checking == CF_NONE which doesn't distinguish between nothing and
-fcf-protection=none.  I'm hoping the fix is simply to use OPTION_SET_P.

             reply	other threads:[~2024-04-05 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 16:09 mpolacek at gcc dot gnu.org [this message]
2024-04-05 16:09 ` [Bug driver/114606] " mpolacek at gcc dot gnu.org
2024-04-10 21:28 ` [Bug target/114606] " cvs-commit at gcc dot gnu.org
2024-04-10 21:28 ` mpolacek at gcc dot gnu.org

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=bug-114606-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).