Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit] dereferencing type-punned pointer will break strict-aliasing rules
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2010-08-12 14:37:09


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 12 August 2010, Emil Dotchevski wrote:
> 2)
> strict aliasing rules should not apply to char pointers (as far as I
> can tell, in_buffer.data is of char type specifically to deal with
> this issue.)

It's safe to cast to a char pointer and use the char pointer, but in this case
you are casting away from a char pointer. Bouncing a non-char pointer
through a char pointer doesn't give any relief from the usual strict aliasing
rules.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkxkP1YACgkQ5vihyNWuA4VslQCfccDLWRNcgpH0OhfT9qxeXJXA
dbQAnjEb+bwpRdUH/2myqMfWMYmBJbCP
=D2e7
-----END PGP SIGNATURE-----


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net