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

Sven Gothel sgothel at jausoft.com
Sun May 6 02:04:04 CEST 2007


On Saturday 05 May 2007 at 02:12, Rich Felker wrote:
> 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. 

I am getting used to your tone ;-)

But what you say below, is exactly what I have meant !
Please consider my mentioning of 'hardware impact', thank you.

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

Indeed.

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

Indeed.

But especially with 'long long' you are on the funny side,
you don't know what you get.
But maybe it's just me old dog, who is not familiar with all this
long long, long double .. ;-)
Isn't it ugly ?

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

As you said, 'requires to be a least' is a little fuzzy, isn't it.
And when it comes to hardware, it's not enough.

And if one really needs 64bit unsigned integer, use uint64_t,
if one just needs a really damn long index, well, long long
may be your friend, but isn't it ugly ?

Agreed, for anything else, just 'int' and 'long' might be ok.

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

Yes, these are allready mapped fixed system types,
mapped regarding their semantics and system imnplementation.

Cheers, Sven

> 
> Rich
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 
> 



-- 
health & wealth
mailto:sgothel at jausoft.com ; www  : http://www.jausoft.ca ; pgp: http://www.jausoft.com/gpg/
land : +1 (780) 637 3842 ; cell: +1 (780) 952 4481
Timezone MST: EST-2, UTC-7, CET-8 ; MDT: EDT-2, UTC-6, CEDT-8



More information about the MPlayer-dev-eng mailing list