On Sat, Jan 23, 2016 at 9:10 PM, Paul Eggert <egg...@cs.ucla.edu> wrote:
> Thanks for checking this so quickly! > > Charles Diza wrote: > > error.c:386:12: warning: data argument not used by format string >> > > That one is a false alarm. The format string might contain fewer formats > than there are arguments, and C allows this so the behavior is > well-defined. Writing it differently would hurt performance slightly. > > > CC strstr.o >> In file included from regex.c:70: >> ./regex_internal.c:1392:11: warning: comparison of unsigned expression < 0 >> is >> always false [-Wtautological-compare] >> if (idx < 0 || idx >= set->nelem) >> ~~~ ^ ~ >> > > Another false alarm. On some configurations idx is signed and so the test > is needed there. It's harmless (no code generated) on your platform, where > idx is unsigned. > > I assume these are Clang warnings. > Yes, these are clang warnings. > > Does the second warning go away if the code looks like this? > > if (((Idx) -1 < 0 && idx < 0) || idx >= set->nelem) > No, the second warning is still there. > Dunno if it's worth this sort of obfuscation just to pacify Clang, tho.... > Probably not. Now that you have confirmed that the warnings are harmless, they don't bother me. Cheers, Charles