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 via email to