Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"02-25-09 - Cast with union"

3 Comments -

1 – 3 of 3
Blogger won3d said...

Have you tried just using memcpy? At least on gcc it is a compiler intrinsic, and for small, constant copies it should do what you want.

February 26, 2009 at 3:02 PM

Blogger cbloom said...

Hmm, that's disturbingly simple and rational.

February 26, 2009 at 3:15 PM

Blogger won3d said...

It also has the advantage of actually being technically correct (and not just practically so) based on a strict reading of the C language spec. Type punning (except char* in certain cases) is actually not guaranteed to work because of strict aliasing.

February 26, 2009 at 5:30 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.