RE: Possible bug in gcc 4.4.7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> So looking into reinterpret_cast is not very relevant.
> 
> You are using a reference of type unsigned int& to access something
> that is not an unsigned int, that's the problem.
> 
> The fact you used reinterpret_cast to create the reference is not
> relevant, it's what you did with the reference after you created it
> that is the problem. This is undefined in the same way, but doesn't use
> reinterpret_cast:
> 
> Flag f1;
> void* vp = &f1;
> *static_cast<unsigned int*>(vp) = 1;


Ok, thanks.  I think I get it now.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux