On 01/01/2018 03:55 AM, Bruno Haible wrote: > Hi, > > Michal Privoznik wrote: >> diff --git a/lib/stat-time.h b/lib/stat-time.h >> index 5f8bf4e12..11acbfb1f 100644 >> --- a/lib/stat-time.h >> +++ b/lib/stat-time.h >> @@ -244,6 +244,8 @@ stat_time_normalize (int result, struct stat *st) >> } >> } >> #endif >> + /* Avoid a "parameter unused" warning. */ >> + (void) st; >> return result; >> } > > Thanks, but this was already discussed and rejected recently: > https://lists.gnu.org/archive/html/bug-gnulib/2017-12/msg00078.html
Compiling gnulib .c files with -Wno-unused-parameter makes total sense to me (we already recommend that projects use a smaller set of -W for gnulib .c files than for their own files, if they like a particularly strict warning). But for inline functions in .h files, where we have less control of which -W options are in effect, it makes more sense to me to accept some form of patch to shut up the compiler. I'm not sure that a cast-to-void is the best approach, or if we can add some compiler attribute instead of a pragma to push/pop a temporary warning relaxation, but I'm not sure we should discard this patch wholesale merely because not all projects use -Wunused-parameter. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature