[FFmpeg-devel] [PATCH 0/2] Fix strict aliasing violations in AAC and AC3 parsers
Mon Dec 15 00:28:27 CET 2008
On Sun, Dec 14, 2008 at 11:07:46PM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> > On Sun, Dec 14, 2008 at 08:53:16PM +0000, Mans Rullgard wrote:
> >> The AAC and AC3 parsers both violate strict aliasing rules when using
> >> a uint64_t variable as buffer for the bitstream reader. Although I am
> >> not entirely certain of the strict validity of these patches, they are
> >> sufficient to make gcc do the right thing, and they can't make things
> >> any worse.
> >> Please comment.
> > ive no objections to these patches, though personally id rather add
> > -fno-strict-aliasing to the flags of these 2 files ...
> I'd rather have correct code than rely on compiler flags altering the
> semantics of the language.
> > not because of these 2, but because more than half of the code in
> > ffmpeg violates the aliasing rules and would we replace all that by
> > unions readability would suffer very significantly.
> Are you suggesting we add -fno-strict-aliasing to the global flags?
> Has anyone benchmarked this? That would also only help with gcc and
> other compilers accepting that flag.
I meant to suggest to add it to files that fail without instead of
spending significant time working around each issue.
But iam not against adding it globaly if someone benchmarked the major
codecs with it.
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel