[FFmpeg-devel] [PATCH] fix 'warning: dereferencing type-punned pointer will break strict-aliasing rules' warning

Michael Niedermayer michaelni
Wed Mar 5 13:27:44 CET 2008


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).

[...]

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080305/cc6194cc/attachment.pgp>



More information about the ffmpeg-devel mailing list