git/compat/regex
Jeff King 4550c16434 compat: disable -Wunused-parameter in 3rd-party code
We carry some vendored 3rd-party code in compat/ that does not build
cleanly with -Wunused-parameters. We could mark these with UNUSED, but
there are two reasons not to:

  1. This is code imported from elsewhere, so we'd prefer to avoid
     modifying it in an invasive way that could create conflicts if we
     tried to pull in a new version.

  2. These files don't include git-compat-util.h at all, so we'd need to
     factor out (or repeat) our UNUSED macro.

In theory we could modify the build process to invoke the compiler with
the extra warning disabled for these files, but there are tricky corner
cases there (e.g., for NO_REGEX we cannot assume that the compiler
understands -Wno-unused-parameter as an option, so we'd have to use our
detect-compiler script).

Instead, let's rely on the gcc diagnostic #pragma. This is horribly
unportable, of course, but it should do what we want.  Compilers which
don't understand this particular pragma should ignore it (per the
standard), and compilers which do care about "-Wunused-parameter" will
hopefully respect it, even if they are not gcc (e.g., clang does).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-28 09:51:18 -07:00
..
regcomp.c compat: disable -Wunused-parameter in 3rd-party code 2024-08-28 09:51:18 -07:00
regex.c compat/regex: move stdlib.h up in inclusion chain 2020-04-27 11:21:16 -07:00
regex.h Merge branch 'jk/asan-build-fix' 2020-01-30 14:17:09 -08:00
regex_internal.c compat/regex: fix argument order to calloc(3) 2024-05-13 10:19:08 -07:00
regex_internal.h compat/regex: move stdlib.h up in inclusion chain 2020-04-27 11:21:16 -07:00
regexec.c compat/regex: fix argument order to calloc(3) 2024-05-13 10:19:08 -07:00