Re: A basic (?) problem with addresses (gcc)





"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


.



Relevant Pages

  • Re: A basic (?) problem with addresses (gcc)
    ... constructions seem to be an elementary property of the C language, ... the compiler caught you at it. ...
    (comp.lang.c)
  • Re: Is Procedural Paradigm a basis of OO Paradigm?
    ... But "procedural decomposition" is a technique, not a language feature. ... constructions, because learning classic procedural decomposition does ... don't find maps the "magic structure" that OO'ers seem to. ... outside the scope of the discussion. ...
    (comp.object)
  • Re: Is Procedural Paradigm a basis of OO Paradigm?
    ... But "procedural decomposition" is a technique, not a language feature. ... constructions, because learning classic procedural decomposition does ... don't find maps the "magic structure" that OO'ers seem to. ... outside the scope of the discussion. ...
    (comp.object)
  • Re: Is Procedural Paradigm a basis of OO Paradigm?
    ... But "procedural decomposition" is a technique, not a language feature. ... constructions, because learning classic procedural decomposition does ... don't find maps the "magic structure" that OO'ers seem to. ... nothing against putting function pointers and/or code snippets into ...
    (comp.object)
  • Re: Etymology of -kuse ni
    ... I sympathize with the desire to deconstruct language in this way to get your ... distorted from the mental gymnastics you go through in trying to analyze it ... Word/particle combinations and language constructions, ... I'm not saying these phrases and constructions don't have any connection to ...
    (sci.lang.japan)