[MPlayer-dev-eng] [PATCH] Fix "initialization discards qualifiers" warnings in cfg-*.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Sep 9 07:19:49 CEST 2010


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


More information about the MPlayer-dev-eng mailing list