|Subject:||Re: address warnings from GCC's UB sanitizer|
|Date:||Sat, 16 Mar 2019 09:41:58 -0700|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1|
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).
|[Prev in Thread]||Current Thread||[Next in Thread]|