This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems shifting an int 32 times. Gcc 3.4.5
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Juan Reina <juanmr at web dot de>
- Date: Tue, 24 Oct 2006 16:32:45 +0100
- Subject: Re: Problems shifting an int 32 times. Gcc 3.4.5
- References: <457682441@web.de>
> I have a problem using the shift operator, maybe a bug (ok, a bug or i'm
> wrong about shift operator)
You are wrong about the shift operator. This is a bug in your code, not a gcc
bug. Shift operators are only defined for non-negative shifts counts less
than the size of the value being shifted.
This is a practical necessity because hardware varies greatly on how it treats
out of range shifts.
Paul