bug-gnulib
[Top][All Lists]
Advanced

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

Re: checking against signed integer overflow


From: Paul Eggert
Subject: Re: checking against signed integer overflow
Date: Sat, 5 Dec 2020 17:51:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

On 12/5/20 7:03 AM, Bruno Haible wrote:

   * The only appropriate answer that is left is
     '-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error'.

Could we document this in the Gnulib documentation?

I gave it a shot by installing the attached patches.

There are a bunch of other flags we could mention, but it might be out of scope for the Gnulib manual.

I'm reluctant to recommend -fsanitize=whatever flags for production builds because they're ABI-incompatible with future library versions; at least, that's what Florian said a couple of years ago <https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/>.

Would it make sense to tell the GCC people that
   - the '-fsanitize=signed-integer-overflow 
-fno-sanitize-recover=signed-integer-overflow'
     options are practically useless when they force a dependency towards 
libstdc++,
   - the 'ftrapv' option is useless when it does not work in combination with
     '-O2' ?

I'm not observing the latter problem with GCC 10.2.1 (Red Hat 10.2.1-9) on Fedora 33 x86-64; maybe it's fixed now? I didn't investigate the former problem, but if it's an issue I suppose it's worth reporting.

Attachment: 0001-doc-mention-static-and-dynamic-checking.patch
Description: Text Data

Attachment: 0002-doc-fix-curved-quotes-issue.patch
Description: Text Data


reply via email to

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