Re: Strange bit shifting result with gcc - am I missing something obvious?
- From: Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 17:18:33 -0400
Boltar wrote:
On 30 Mar, 21:37, jacob navia <ja...@xxxxxxxxxx> wrote:The result of shifting more than sizeof(int)*CHAR_BIT positions
is NOT defined by the language. It is an illegal expression.
It isn't? Thats bloody annoying since that means i'll have to do a
specific check for the bit shift count being > than the size of the
type being shifted.
Actually, you need to check for >=, not just >. And
with signed integers, you need to be sure the value being
shifted is non-negative and small enough that no 1's are
propagated into the sign position.
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.
- References:
- Prev by Date: Re: creating a testfile for catv
- Next by Date: Re: Strange bit shifting result with gcc - am I missing something obvious?
- Previous by thread: Re: Strange bit shifting result with gcc - am I missing something obvious?
- Next by thread: Re: Strange bit shifting result with gcc - am I missing something obvious?
- Index(es):
Relevant Pages
|
|