This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problems shifting an int 32 times. Gcc 3.4.5
- From: Juan Reina <juanmr at web dot de>
- To: gcc at gnu dot org
- Date: Tue, 24 Oct 2006 17:21:36 +0200
- Subject: Problems shifting an int 32 times. Gcc 3.4.5
- Reveived: from web.de by fmmailgate09.web.de (Postfix) with SMTP id 604E51CEB04 for <gcc@gnu.org>; Tue, 24 Oct 2006 17:21:38 +0200 (CEST)
Hello:
I have a problem using the shift operator, maybe a bug (ok, a bug or i'm wrong about shift operator)
System: i386-redhat-linux
Version: Gcc 3.4.5
Case:
In the next snipplet:
unsigned int getMask(int n){
unsigned int mask = 0;
a = ~(~(a)<<n);
}
In case of n<32, the function works correct but if n=32, the value of a is 0 (when should be 0xFFFF).
Thanks in advance
Juan
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066