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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
            Version|8.0                         |7.0
           Keywords|                            |diagnostic
   Last reconfirmed|                            |2017-07-06
          Component|driver                      |other
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot 
gnu.org
     Ever confirmed|0                           |1
            Summary|-Wall resets default option |-Wall resets
                   |arguments to 1              |-Wstringop-overflow to 1
                   |                            |from the default 2

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Doh!  Thanks for the hint!  This ability is already there in LangEnabledBy:

  LangEnabledBy(language, opt, posarg, negarg)

I expected the default LangEnabledBy setting to use the default value specified
by the Init() directive.

So it's a bug in the -Wstringop-overflow specification in the c.opt file.  It
should be:

Wstringop-overflow=
C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow)
Init(2) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall, 2, 0) IntegerRange(0, 4)

With this it works as expected.

Reply via email to