Re: clisp -Wshift-negative-value on

Bruno Haible <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <17292300.eGEoOTLY2Z@omega>
Hi Sam,

> ../src/debug.d:571:7: warning: shifting a negative signed value is undefined
>       [-Wshift-negative-value]
>
> $ gcc --version
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
> Apple LLVM version 8.0.0 (clang-800.0.42.1)

http://stackoverflow.com/questions/3784996/why-does-left-shift-operation-invoke-undefined-behaviour-when-the-left-side-oper
does not give me any insight about the real reasons of the warning.

Generally, some operations on signed integers now give undefined behaviour,
and some compilers like GCC exploit this. So, it is nowadays generally wiser
to do bit manipulations only on unsigned integers. I guess it will be a lot
of work to revisit clisp's code in this direction. The first step towards
this is to pick the relevant warnings. So far, I'd guess that
-Wshift-negative-value is not among the relevant warnings.

Bruno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.