[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22444: compiler warnings in test snapshot

From: Paul Eggert
Subject: bug#22444: compiler warnings in test snapshot
Date: Sat, 23 Jan 2016 18:10:15 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

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
       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.

Does the second warning go away if the code looks like this?

  if (((Idx) -1 < 0 && idx < 0) || idx >= set->nelem)

Dunno if it's worth this sort of obfuscation just to pacify Clang, tho....

reply via email to

[Prev in Thread] Current Thread [Next in Thread]