[MPlayer-dev-eng] [PATCH] Fix "initialization discards qualifiers" warnings in cfg-*.h
ubitux
ubitux at gmail.com
Thu Sep 9 13:49:46 CEST 2010
On Thu, Sep 09, 2010 at 07:19:49AM +0200, Reimar Döffinger wrote:
> On Wed, Sep 08, 2010 at 11:01:06PM +0200, ubitux wrote:
> > The void *p pointer initialization in the m_option array have mixed
> > initialization (sometimes with the '&' unary operator, sometimes not). The
> > patch also makes this consistent.
>
> It's not inconsistent, we don't use & to get the address of an array type,
> only for the other types.
Oh well ok… may I ask why?
> Changing it here might make that look more consistent but it is inconsistent
> with all other code.
>
> > The mplayer and mencoder binaries don't change after applying the
> > patch, so I suppose it's fine. I'm sure there is a reason for not having
> > this done before, but I propose the patch anyway…
>
> Because the code just isn't particularly good. Just hiding the issue
> isn't exactly a solution.
> Also all those suboptions should be const so there should be a lot more
> warnings.
> The warnings could be avoided by
> 1) compiling the array in a separate .c file and disabling thw warning for them
> 2) try to fix the const-correctness of the option parser for the CONF_TYPE_SUBCONFIG case
Ok for the second point, but as I ask above, I don't see the matter in
converting explicitly the arrays to pointers here.
--
ubitux
More information about the MPlayer-dev-eng
mailing list