[MPlayer-dev-eng] [PATCH] kill a few warnings (more completepatch)

D Richard Felker III dalias at aerifal.cx
Fri Sep 12 18:48:38 CEST 2003


On Fri, Sep 12, 2003 at 12:03:52PM +0200, Pierre Lombard wrote:
> Hi,
> 
> * Sycotic Smith <sycotic at linuxmail.org> [2003-09-11 16:43]:
> > > Index: libao2/pl_resample.c
> > > ===================================================================
> 
> > > -static pl_resample_t 	pl_resample	= {NULL,NULL,1,1,1,0,W};
> > > +static pl_resample_t 	pl_resample = {
> > > +	.data = NULL,
> > > +	.w = NULL,
> > > +	.dn = 1,
> > > +	.up = 1,
> > > +	.channels = 1,
> > > + 	.len = 0,
> > > +	.ws = W,   <this line! and many more followed...>
> > > +};
> > 
> > I'm no expert, but wouldn't the trailing ',' on all the last parms give yet another warning? They always seem to when I forget and put them in...
> 
> I guess it depends on your compiler version and which C standard it
> implements.  The trailing ',' should be ok in C99 (IIRC).
> 
> The attached code snippet should exhibit every possible warning for
> those struct initializers.
> 
> So, if you get a warning, it means your cc is not C99 compliant. Anyway

Huh? A compiler can (and should) give warnings for bad practices (i.e.
indicate a likely error) that are still compliant to the language.

Rich



More information about the MPlayer-dev-eng mailing list