[MPlayer-cvslog] r33911 - trunk/stream/cache2.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jul 25 19:42:21 CEST 2011


On Mon, Jul 25, 2011 at 01:51:51AM +0200, diego wrote:
> Author: diego
> Date: Mon Jul 25 01:51:51 2011
> New Revision: 33911
> 
> Log:
> cache2: add missing braces to silence compiler warning
> 
> stream/cache2.c:387: warning: missing braces around initializer
> 
> Modified:
>    trunk/stream/cache2.c
> 
> Modified: trunk/stream/cache2.c
> ==============================================================================
> --- trunk/stream/cache2.c	Sun Jul 24 23:45:19 2011	(r33910)
> +++ trunk/stream/cache2.c	Mon Jul 25 01:51:51 2011	(r33911)
> @@ -384,7 +384,7 @@ static void dummy_sighandler(int x) {
>  static void cache_mainloop(cache_vars_t *s) {
>      int sleep_count = 0;
>  #if FORKED_CACHE
> -    struct sigaction sa = { 0 };
> +    struct sigaction sa = { { 0 } };

This is wrong, POSIX does not require it to start with or even contain
a struct or union.
Thus your code potentially will not compile on some systems.
If you want to get rid of the warning you'll have to use memset.
I couldn't decide whether the warning or using memset was uglier so
I left it as it was.


More information about the MPlayer-cvslog mailing list