← Back to context

Comment by naruhodo

1 month ago

If it's C code, that is the way to suppress a compiler warning about sig being unused. In C++ you can omit (or comment-out) the parameter name, e.g.:

    // C++
    void on_sigchld(int /*sig*/) {}

That is K&R C syntax, supported up to C18. The solution to tools emitting unwanted diagnostics is not to appease them with pointless cruft but to shut off the diagnostic:

  -Wall -Wextra -Wno-unused-parameter