This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: shifting
- From: Nathan Sidwell <nathan at acm dot org>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Marko Mlinar <markom at opencores dot org>, gcc at gcc dot gnu dot org
- Date: Thu, 04 Jul 2002 09:40:48 +0100
- Subject: Re: shifting
- References: <004901c22323$876de930$0301010a@tyr> <20020704064236.GC15047@codesourcery.com>
- Reply-to: nathan at compsci dot bristol dot ac dot uk
Zack Weinberg wrote:
>
> On Thu, Jul 04, 2002 at 08:25:01AM +0200, Marko Mlinar wrote:
> > Hello!
> >
> > About some time I noticed gcc has strange "feature" with shifting.
>
> Whenever you shift a number left or right by more than the width of
off by one :) ----------------------------------^ or equal to
> its type, the behavior is undefined -- the compiler is allowed to do
> whatever it pleases.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
The voices in my head told me to say this
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk