[MPlayer-dev-eng] [PATCH] Silence some -Wundef warnings

Diego Biurrun diego at biurrun.de
Tue Jan 22 11:21:49 CET 2013


On Mon, Jan 21, 2013 at 11:27:58PM -0500, Josh wrote:
> On 1/21/2013 17:58, Diego Biurrun wrote:
> >On Tue, Jan 08, 2013 at 11:39:27AM +0100, Erik Auerswald wrote:
> >>
> >>the attached patch silences some -Wundef warnings by always creating
> >>the relevant #defines, even when not configuring for Windows:
> >>
> >>libdvdcss/libdvdcss.c:123:5: warning: "HAVE_DIRECT_H" is not defined
> >>[-Wundef]
> >>libdvdcss/libdvdcss.c:241:5: warning: "HAVE_DIRECT_H" is not defined
> >>[-Wundef]
> >>libavformat/cache.c:36:5: warning: "HAVE_IO_H" is not defined [-Wundef]
> >>libavformat/file.c:26:5: warning: "HAVE_IO_H" is not defined [-Wundef]
> >>libavutil/file.c:28:5: warning: "HAVE_IO_H" is not defined [-Wundef]
> >>libavutil/log.c:32:5: warning: "HAVE_IO_H" is not defined [-Wundef]
> >>
> >>I have tested the patch on GNU/Linux, not on Windows, but it looks
> >>"obviously correct" to me. ;-)
> >
> >I only saw this patch now and already fixed the issue differently
> >earlier today.  Thanks for the patch anyway.
> >
> >In case you are motivated, there are many -Wundef warnings lurking
> >still :)
> 
> This is what I came up with so far it is still a work in progress, I
> cut 32 Wundefs down to 7. I only tested  under MinGW/Windows and
> checked against ffmpeg's config.h for defines that should be "1".
> 
> --- configure	(revision 35820)
> +++ configure	(working copy)
> @@ -3264,13 +3264,46 @@
>  echocheck "nanosleep"
>  _nanosleep=no
>  statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
>  if test "$_nanosleep" = yes ; then
>    def_nanosleep='#define HAVE_NANOSLEEP 1'
>  else
> -  def_nanosleep='#undef HAVE_NANOSLEEP'
> +  def_nanosleep='#define HAVE_NANOSLEEP 0'
>  fi
>  echores "$_nanosleep"

You're not adjusting the code to match this semantic change.

> @@ -8617,7 +8724,9 @@
>  
>  /* system functions */
> +$def_cryptgenrandom
>  $def_gethostbyname2
> +$def_getprocessaffinitymask
>  $def_gettimeofday
>  $def_glob
>  $def_langinfo

Most of the stuff you add is for libav*, so you should move those entries
to the appropriate place in config.h.

> @@ -9015,6 +9131,7 @@
>  #define CONFIG_GRAY 0
>  #define CONFIG_LIBMODPLUG 0
>  #define CONFIG_LIBVORBIS 0
> +#define CONFIG_MEMORY_POISONING 0
>  #define CONFIG_OPENSSL 0
>  #define CONFIG_POWERPC_PERF 0
>  /* For now prefer speed over avoiding potential invalid reads */

This could be separated and directly applied; same for other bits of
your patch.

Diego


More information about the MPlayer-dev-eng mailing list