[MPlayer-dev-eng] add -Wall to default CFLAGS

Rich Felker dalias at aerifal.cx
Sat May 5 10:12:56 CEST 2007


On Sat, May 05, 2007 at 12:34:49AM -0600, Sven Gothel wrote:
> > Atm. I'm wondering how to integrate some code using long long from
> > mp3lib into mpg123, which used to be C89 up to now...
> 
> yeah .. good one.
> 
> shouldn't we restrict types, which have an 'so lala' hardware impact
> to POSIX safe ones, i.e. uint64_t, uint32_t, .. etc. ?
> 
> IMHO this is a must !
> 
> And forget all about this 'long long' - you never know what you get - types.

This is stupid. [u]intXX_t types are for when you need exactly a
specific size, e.g. for arrays of samples that need to be in a
particular native format for copying to a device, or when the volume
of data mandates that you not use a type larger than needed.
Otherwise, you should use int, long, etc. as appropriate. Littering
the code with explicit size requirements is both ugly and likely to
hurt performance on future machines. The faad developers did this all
over their code, using int16_t for individual (non-array) local
variables and stuff.

FYI C99 requires int to be at least 16bit, long to be at least 32bit,
and long long to be at least 64bit. POSIX further requires int to be
at least 32bit, as it is on any remotely usable system.

For other types such as file offsets, array sizes, etc. you have
off_t, size_t, ptrdiff_t, etc...

Rich



More information about the MPlayer-dev-eng mailing list