lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 00/11] treewide: Fix a bunch of shift overflows
Date
From: Borislav Petkov
> Sent: 05 April 2022 16:15
...
> Due to some recent changes which added -fsanitize-shift to the build
> options of an allmodconfig, it started failing here with an old gcc
> because getting an overflow while shifting is undefined C99 behavior.

Annoyingly it is extremely unlikely that a 2s compliment
system would ever generate anything other than the expected
value - ie the value obtained by doing the calculation
with unsigned values and then getting the result cast back
to signed (which is IIRC implementation defined).

It isn't as though there are many 1s compliment systems out
there, and probably even fewer 'sign overpunch' ones.
Never mind trying to find a working C compiler for them.

What sort of crack are the C standards body and compiler
people actually smoking?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2022-04-06 15:02    [W:1.066 / U:23.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site