[FFmpeg-devel] [PATCH] fix 'warning: dereferencing type-punned pointer will break strict-aliasing rules' warning
mark cox
melbournemark+ffmpeg
Wed Mar 5 15:11:38 CET 2008
On Wed, Mar 5, 2008 at 11:27 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:
> On Wed, Mar 05, 2008 at 08:08:54PM +0800, Zuxy Meng wrote:
> > Hi,
> >
> > 2008/3/5, Michael Niedermayer <michaelni at gmx.at>:
> > > On Wed, Mar 05, 2008 at 12:51:04PM +0100, Michael Niedermayer wrote:
> > > > On Wed, Mar 05, 2008 at 09:47:26PM +1100, mark cox wrote:
> > > > > Here is a patch to fix the 'warning: dereferencing type-punned
> pointer will
> > > > > break strict-aliasing rules' warning.
> > > >
> > > > patch rejected
> > >
> > > Just to clarify even though it should be clear to every C programmer.
> > > The warnings point to bugs, the bugs are not fixed by this patch.
> >
> > Someone willing to tell me the history about the "declared as uint64_t
> > and cast to short" thing? Looks to me as a workaround for some
> > compiler bug.
>
> Yes, old versions of gcc (dont ask which i dunno) ignored align attributes
> for stack variables entirely, but they did align uint64_t to 8 bytes even
> when it was on the stack (given that the stack was properly aligned).
>
> [...]
>
What would be the correct way to fix this then? or is it unfixable while we
still support old gcc versions?
Regards,
mark
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Dictatorship naturally arises out of democracy, and the most aggravated
> form of tyranny and slavery out of the most extreme liberty. -- Plato
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHzpG+YR7HhwQLD6sRAgGYAJ41cQTCkup3MHEJQHJgM2xs6IsC5QCglWdb
> oWsrt3WzODUkonREl3zKcuw=
> =uu0q
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list