]> git.ipfire.org Git - thirdparty/git.git/commit
CodingGuidelines: mention -Wunused-parameter and UNUSED
authorJeff King <peff@peff.net>
Wed, 28 Aug 2024 14:48:14 +0000 (10:48 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Aug 2024 16:51:25 +0000 (09:51 -0700)
commita61bc8879eaade17eccec2a22693501480843db1
tree1bd1c2123e47211a6131a678973914c71c25a076
parenta219a6739cc14b52a7ba08170eebe9cf11505667
CodingGuidelines: mention -Wunused-parameter and UNUSED

Now that -Wunused-parameter is on by default for DEVELOPER=1 builds,
people may trigger it, blocking their build. When it's a mistake for the
parameter to exist, the path forward is obvious: remove it. But
sometimes you need to suppress the warning, and the "UNUSED" mechanism
for that is specific to our project, so people may not know about it.

Let's put some advice in CodingGuidelines, including an example warning
message. That should help people who grep for the warning text after
seeing it from the compiler.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines