This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix aliasing warning


> This is unfortunate, and does expose aliasing issues.  Luckily I think the 
> aliasing won't bite as we don't read through one then write through the 
> other within the same compiler visible code.

> !       sc = (struct sigcontext *) &rt_->uc.uc_mcontext;
.....
> !       /* The void * cast is necessary to avoid an aliasing warning.
> !          The aliasing warning is correct, but should not be a problem
> !          because it does not alias anything.  */
> !       sc = (struct sigcontext *) (void *)&rt_->uc.uc_mcontext;

Hmm, as far as I know this does not fix the bug, it just hides
the warning?

At least thats what I got told as I added (char*) casts to similar code.
 
Ciao, Marcus

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]