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

            Bug ID: 121305
           Summary: -Wunused-parameter shouldn't warn about naked
                    functions not using their params
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pskocik at gmail dot com
  Target Milestone: ---

By definition, a naked function (=an asm block only) cannot use its parameters
in C code, so it's a little silly to warn about it not doing something it
cannot do.
(The only way to suppress the warning for naked function on gcc is to either
use a pragma around the function or mark each paramater __attribute((unused))).

Clang intelligently suppresses -Wunused-parameter for naked functions. It would
be nice if gcc did the same (example: https://godbolt.org/z/rhrdGvshM).

Reply via email to