[Ffmpeg-devel] [PATCH] Fix compiler warning in libavcodec/dsputil.c

Guillaume POIRIER poirierg
Mon Aug 7 11:53:04 CEST 2006


On 6/25/06, Pieter Hollants <pieter at hollants.com> wrote:
> Hash: SHA1
> Ok, patches revisited, this is the first hunk of what I sent before.
> This fixes the warning in libavcodec/dsputil.c's dct264_sad8x8_c the
> same way dct_sad8x8_c does it, by typecasting to (DCTELEM *). The only
> other way I can think of would be to modify the diff_pixel prototypes,
> but since the typecast exists in the other function already, I assume
> this was not done by intent.
> This one ok?

I don't think this patch is desirable or improves anything. It's quite
common in multimedia code to pass an object of different type or size
if you know what you are doing (and the author of this code knows what
he is doing).

There was an article about this on LWN.net some month ago. I can't
find the link anymore, but what it said is:
"don't use typecasts to hide warnings" and "leaving some warnings here
and there is good because it will make ppl periodically look at the
'offending code' to see if it's okay"

Conditional branch execution in SIMD vector processors are patented! :
All ASM SIMD code writers are outlaws!

More information about the ffmpeg-devel mailing list