Jonathan Larmour <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: >> Andrew Lunn <[EMAIL PROTECTED]> writes: >> >>>>The updated patch is attached. >>>> >>> >>>Hi Sergei >>> >>>Im looking at the patch now ready for including into anoncvs. I have >>>one minor problem which needs fixing. When i compile for the linux >>>target with gcc 4.1.2 i get a warning: >> >> >> There doesn't seem to be a way to actually fix this warning, only some >> hacks to shut-up GCC. What hack in particular do you use to prevent this >> kind of warnings in other places of eCos where it occurs? > > There is a correct solution. Create a one-off union type, containing a > FILE and a Cyg_VsnprintfStream and assign the stream to the > Cyg_VsnprintfStream, and then take the address of the FILE > member. Alignment constraints are dealt with by the fact that streams > are created with the correct alignment - but GCC doesn't know that.
In my previous answer I forgot to mention another correct solution to the problem, -- compiling eCos with -fno-strict-aliasing. So which one should we finally choose? -- Sergei Organov.
