Left shift of negative value
Andrew Haley
aph@redhat.com
Tue Dec 1 17:15:00 GMT 2015
On 12/01/2015 05:11 PM, Martin Sebor wrote:
> On 12/01/2015 09:07 AM, Andrew Haley wrote:
>> Do we support left shift of a negative value? Technically it's
>> undefined and ubsan warns about it. However, a ton of software would
>> surely break if we didn't do the obvious right thing. I can't find
>> anything in the GCC manual.
>>
>
> I believe gcc does the expected thing but see bug 65179:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=65179
>
> There have been discussions on gcc-patches about some of
> the issues the warning has exposed (real or otherwise),
> for example:
>
> https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00696.html
OK, thanks. I wonder if we should document this as a GCC extension.
Leaving it up in the air like this does no-one any good.
Andrew.
More information about the Gcc-help
mailing list