Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Jonathan Wakely
On 7 June 2011 15:39, Richard Guenther wrote: > On Tue, Jun 7, 2011 at 4:31 PM, Jonathan Wakely wrote: >> On 7 June 2011 15:20, Richard Guenther wrote: However, for my construct, which appears to be completely legal, I get a warning, which I'd like to disable.  How can I do that?  

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Richard Guenther
On Tue, Jun 7, 2011 at 4:31 PM, Jonathan Wakely wrote: > On 7 June 2011 15:20, Richard Guenther wrote: >>> >>> However, for my construct, which appears to be completely legal, I get a >>> warning, which I'd like to disable.  How can I do that?  Currently I'm using >>> -Wno-strict-aliasing, but I'd

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Jonathan Wakely
On 7 June 2011 15:20, Richard Guenther wrote: >> >> However, for my construct, which appears to be completely legal, I get a >> warning, which I'd like to disable.  How can I do that?  Currently I'm using >> -Wno-strict-aliasing, but I'd like to have a better solution.  I tried to >> cast (void*) b

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Richard Guenther
On Tue, Jun 7, 2011 at 4:05 PM, Herman, Geza wrote: > On 06/07/2011 03:02 PM, Richard Guenther wrote: >> >> On Tue, Jun 7, 2011 at 2:58 PM, Herman, Geza  wrote: >>> >>> On 06/07/2011 12:27 PM, Richard Guenther wrote: On Tue, Jun 7, 2011 at 5:51 AM, Herman, Geza    wrote: > > Hi,

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Jonathan Wakely
On 7 June 2011 15:05, Herman, Geza wrote: > > However, for my construct, which appears to be completely legal, I get a > warning, which I'd like to disable.  How can I do that?  Currently I'm using > -Wno-strict-aliasing, but I'd like to have a better solution.  I tried to > cast (void*) before the

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Herman, Geza
On 06/07/2011 03:02 PM, Richard Guenther wrote: On Tue, Jun 7, 2011 at 2:58 PM, Herman, Geza wrote: On 06/07/2011 12:27 PM, Richard Guenther wrote: On Tue, Jun 7, 2011 at 5:51 AM, Herman, Gezawrote: Hi, Sorry, if it has been discussed before, I found a lot of information on strict alia

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Herman, Geza
On 06/07/2011 12:27 PM, Richard Guenther wrote: On Tue, Jun 7, 2011 at 5:51 AM, Herman, Geza wrote: Hi, Sorry, if it has been discussed before, I found a lot of information on strict aliasing in gcc, but nothing about this particular case. I'd like to code a custom container class: it has a c

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Richard Guenther
On Tue, Jun 7, 2011 at 2:58 PM, Herman, Geza wrote: > On 06/07/2011 12:27 PM, Richard Guenther wrote: >> >> On Tue, Jun 7, 2011 at 5:51 AM, Herman, Geza  wrote: >>> >>> Hi, >>> >>> Sorry, if it has been discussed before, I found a lot of information on >>> strict aliasing in gcc, but nothing about

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Richard Guenther
On Tue, Jun 7, 2011 at 5:51 AM, Herman, Geza wrote: > Hi, > > Sorry, if it has been discussed before, I found a lot of information on > strict aliasing in gcc, but nothing about this particular case.  I'd like to > code a custom container class: it has a char[] (or dynamically allocated > "char *"

Re: strict aliasing: cast from char[] or char *

2011-06-07 Thread Jonathan Wakely
Please send questions about using GCC to gcc-h...@gcc.gnu.org, this mailing list is for discussing development of GCC, thanks. On 7 June 2011 04:51, Herman, Geza wrote: > > Here, gcc warns on the reinterpret_cast line. Which version?

strict aliasing: cast from char[] or char *

2011-06-06 Thread Herman, Geza
Hi, Sorry, if it has been discussed before, I found a lot of information on strict aliasing in gcc, but nothing about this particular case. I'd like to code a custom container class: it has a char[] (or dynamically allocated "char *") for storage, putting an element is done with placement ne