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

            Bug ID: 90983
           Summary: manual documents `-Wno-stack-usage` flag, but it is
                    unrecognized
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc_bugs at codyps dot com
  Target Milestone: ---

Previously (in gcc-8 of some version), `-Wstack-usage=0` would disable
stack-usage checking. In 9.1.0, however, `-Wstack-usage=0` appears to read
"warn if any usage greater than 0 bytes occurs". This lead me to try to use the
`-Wno-stack-usage` flag, which is documented in the manual:

     -Wno-stack-usage
           Disable -Wstack-usage= warnings.  The option is equivalent to
-Wstack-usage=SIZE_MAX or larger.

However, this negative flag appears non-functional:

[cody@franklin gcc]$ echo 'int main(void) { return 0; }' | /usr/bin/gcc -Wall
-Werror -Wextra -Wstack-usage=0 -Wno-stack-usage -c -x c -
<stdin>: In function ‘main’:
<stdin>:1:5: error: stack usage is 16 bytes [-Werror=stack-usage=]
<stdin>: At top level:
cc1: error: unrecognized command line option ‘-Wno-stack-usage’ [-Werror]
cc1: all warnings being treated as errors


(Note: I've used `-Wstack-usage=0` here to generate show that
`-Wno-stack-usage` fails to disable the stack-usage warning. If no warning
other warning is generated, the unrecognized command line option of
`-Wno-stack-usage` is not emitted, even with `-Werror`).

Indeed, looking at `gcc/common.opt` shows `RejectNegative` for `Wstack-usage=`.

I haven't yet located where the behavior of `Wstack-usage` was changed wrt `0`.

Reply via email to