> Am 15.09.2023 um 17:25 schrieb Qing Zhao <qing.z...@oracle.com>: > > > >> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović <ar...@aarsen.me> wrote: >> >> >> Qing Zhao <qing.z...@oracle.com> writes: >> >>> Even though unsigned integer overflow is well defined, it might be >>> unintentional, shall we warn user about this? >> >> This would be better addressed by providing operators or functions that >> do overflow checking in the language, so that they can be explicitly >> used where overflow is unexpected. > > Yes, that will be very helpful to prevent unexpected overflow in the program > in general. > However, this will mainly benefit new codes. > > For the existing C codes, especially large applications, we still need to > identify all the places > Where the overflow is unexpected, and fix them. > > One good example is linux kernel. > >> One could easily imagine a scenario >> where overflow is not expected in some region of code but is in the >> larger application. > > Yes, that’s exactly the same situation Linux kernel faces now, the unexpected > Overflow and > expected wrap-around are mixed together inside one module. > It’s hard to detect the unexpected overflow under such situation based on the > current GCC. But that’s hardly GCCs fault nor can GCC fix that in any way. Only the programmer can distinguish both cases. Richard > Thanks. > > Qing >> -- >> Arsen Arsenović >
Re: Question on -fwrapv and -fwrapv-pointer
Richard Biener via Gcc-patches Fri, 15 Sep 2023 08:29:32 -0700
- Re: Question on -fwrapv and -fwrapv-point... Xi Ruoyao via Gcc-patches
- Re: Question on -fwrapv and -fwrapv-... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Andrew Pinski via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Xi Ruoyao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Andrew Pinski via Gcc-patches
- Re: Question on -fwrapv and -fwr... Kees Cook via Gcc-patches
- Re: Question on -fwrapv and -fwr... Arsen Arsenović via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Richard Biener via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Xi Ruoyao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Richard Biener via Gcc-patches
- Re: Question on -fwrapv and -fwr... Qing Zhao via Gcc-patches
- Re: Question on -fwrapv and -fwr... Kees Cook via Gcc-patches
- Re: Question on -fwrapv and -fwr... Kees Cook via Gcc-patches