Paul Eggert wrote:
Akim Demaille wrote:
Are you aware of any way to use this macro and avoid these spurious warnings?
Sure, don't use -Wtype-limits and don't use
-Wtautological-constant-out-of-range-compare. That's standard practice in other
GNU projects. These warnings generate too many false alarms in code that checks
for integer overflow properly.
I should also mention that recent GCC versions do better in this area, due to
the fact that they have builtins that avoid the warnings. So one possibility is
to enable those particular warnings only if GCC is new enough. However, I
haven't bother to do that myself, as I haven't found the warnings useful (too
many false alarms anyway).