[MPlayer-cvslog] r34290 - trunk/configure

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Nov 3 20:05:49 CET 2011


On Thu, Nov 03, 2011 at 03:23:17PM +0100, diego wrote:
> Author: diego
> Date: Thu Nov  3 15:23:17 2011
> New Revision: 34290
> 
> Log:
> configure: add braces to initializer in vsscanf test to shut up a gcc warning
> 
> Modified:
>    trunk/configure
> 
> Modified: trunk/configure
> ==============================================================================
> --- trunk/configure	Thu Nov  3 15:23:14 2011	(r34289)
> +++ trunk/configure	Thu Nov  3 15:23:17 2011	(r34290)
> @@ -3843,7 +3843,7 @@ cat > $TMPC << EOF
>  #define _ISOC99_SOURCE
>  #include <stdarg.h>
>  #include <stdio.h>
> -int main(void) { va_list ap = { 0 }; vsscanf("foo", "bar", ap); return 0; }
> +int main(void) { va_list ap = { { 0 } }; vsscanf("foo", "bar", ap); return 0; }

I think you've made that kind of mistake before.
The standard does not make any promises about the layout of va_list.
Thus your new code can and probably will fail to compile on systems with
perfectly fine vsscanf support.
The original code was correct, just not initializing at all would be correct,
using memset would be correct, going crazy and adding a var-arg function
and properly using va_start would be too.
But this one is not.
No idea which of these do or do not cause warnings.


More information about the MPlayer-cvslog mailing list