On 21/09/2010 09:23, Simen kjaeraas wrote:
bearophile <[email protected]> wrote:
klickverbot:
Are there any cases where (*cast(int*)&someFloat) does not fit the bill?
I am not a C lawyer, but I think that too is undefined in C (and maybe
D too).
From your own link
(http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=109033):
"I don't see any way to make conversions between pointers and ints
implementation defined, and make dereferencing a pointer coming from
some int anything but undefined behavior."
That's not the same thing. Walter was referring to casting an int to a
pointer, but the above is casting a _float pointer_ to an _int pointer_.
--
Bruno Medeiros - Software Engineer