Re: A basic (?) problem with addresses (gcc)
- From: "BartC" <bc@xxxxxxxxxx>
- Date: Wed, 15 Dec 2010 20:45:00 -0000
"Seebs" <usenet-nospam@xxxxxxxxx> wrote in message news:slrnigi7cp.14pa.usenet-nospam@xxxxxxxxxxxxxxxxxx
On 2010-12-15, Piotrne <piotr23ne@xxxxxxxxxxxxxx> wrote:The first result is correct, but what happened to the second?
Your code was wrong. The compiler did whatever it wanted.
Probably addresses have been shifted for some reason. But such
constructions seem to be an elementary property of the C language,
and they don???t work...
Nope. You invoked undefined behavior, the compiler caught you at it.
What was wrong with it? Assuming int and float are the same sizes and are aligned in a compatible way.
--
Bartc
.
- Follow-Ups:
- Re: A basic (?) problem with addresses (gcc)
- From: Seebs
- Re: A basic (?) problem with addresses (gcc)
- From: jacob navia
- Re: A basic (?) problem with addresses (gcc)
- References:
- A basic (?) problem with addresses (gcc)
- From: Piotrne
- Re: A basic (?) problem with addresses (gcc)
- From: Seebs
- A basic (?) problem with addresses (gcc)
- Prev by Date: Re: Lowest addressed character in array
- Next by Date: Re: Lowest addressed character in array
- Previous by thread: Re: A basic (?) problem with addresses (gcc)
- Next by thread: Re: A basic (?) problem with addresses (gcc)
- Index(es):
Relevant Pages
|