Paul Eggert <address@hidden
> schrieb am Di., 13. Juni 2017 um 22:44 Uhr:
Part of the attached patch, recently installed into master, would be
automatically reverted the next time we merged from gnulib, since
strftime.c is copied from Gnulib. I'm not getting a warning when
compiling with Clang, so I'm puzzled as to why the patch was needed.
Here's how I build (on Fedora 25):
./configure --enable-gcc-warnings CC=clang
Fedora 25 is running clang version 3.9.1 (tags/RELEASE_391/final).
I get this on macOS with -O3 and -enable-gcc-warnings, using Apple's fork of Clang (i.e. the default system compiler).
Background: I would rather avoid the need for this sort of patch, as we
shouldn't have to complicate the code just to pacify a Clang false
alarm. If an older Clang is generating a false alarm, let's just ignore
the diagnostic. If it's a newer Clang, let's change the options to Clang
to suppress the diagnostic.
I'd prefer to not suppress the diagnostic globally, because these warnings are generally useful in other places.
Would you accept introducing pragmas to temporarily disable the warnings in Clang (#pragma clang diagnostic push/ignore/pop), with an explanation why they are false positives in these cases?