diff mbox series

[FFmpeg-devel] avutil/attributes: Fix too many warning: false is not defined [-Wundef]

Message ID 1590751137-4637-1-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 77e15f01fb876561054376c11b1529b202f8130d
Headers show
Series [FFmpeg-devel] avutil/attributes: Fix too many warning: false is not defined [-Wundef] | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang May 29, 2020, 11:18 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
try to avoid floods of warning message for my testing linux host. If you
have better way, fix it anyway.

Below is my Linux system information and gcc version:

[lmwang@vpn2 ffmpeg.git]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
[lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)

 libavutil/attributes.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer May 29, 2020, 7:12 p.m. UTC | #1
On 5/29/2020 8:18 AM, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> try to avoid floods of warning message for my testing linux host. If you
> have better way, fix it anyway.
> 
> Below is my Linux system information and gcc version:
> 
> [lmwang@vpn2 ffmpeg.git]$ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
> [lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
> CentOS Linux release 7.4.1708 (Core)
> 
>  libavutil/attributes.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> index ab2a1fd..5cb9fe3 100644
> --- a/libavutil/attributes.h
> +++ b/libavutil/attributes.h
> @@ -37,7 +37,7 @@
>  #ifdef __has_builtin
>  #    define AV_HAS_BUILTIN(x) __has_builtin(x)
>  #else
> -#    define AV_HAS_BUILTIN(x) false
> +#    define AV_HAS_BUILTIN(x) 0
>  #endif
>  
>  #ifndef av_always_inline

LGTM
Carl Eugen Hoyos May 29, 2020, 9:46 p.m. UTC | #2
> Am 29.05.2020 um 13:18 schrieb lance.lmwang@gmail.com:
> 
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> try to avoid floods of warning message for my testing linux host. If you
> have better way, fix it anyway.
> 
> Below is my Linux system information and gcc version:
> 
> [lmwang@vpn2 ffmpeg.git]$ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
> [lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
> CentOS Linux release 7.4.1708 (Core)
> 
> libavutil/attributes.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> index ab2a1fd..5cb9fe3 100644
> --- a/libavutil/attributes.h
> +++ b/libavutil/attributes.h
> @@ -37,7 +37,7 @@
> #ifdef __has_builtin
> #    define AV_HAS_BUILTIN(x) __has_builtin(x)
> #else
> -#    define AV_HAS_BUILTIN(x) false
> +#    define AV_HAS_BUILTIN(x) 0
> #endif

Please move the define to an internal header.

This has to be detected in configure, I just have to find time to implement this.

Thank you, Carl Eugen
Lance Wang May 29, 2020, 11:27 p.m. UTC | #3
On Fri, May 29, 2020 at 11:46:05PM +0200, Carl Eugen Hoyos wrote:
> 
> 
> 
> > Am 29.05.2020 um 13:18 schrieb lance.lmwang@gmail.com:
> > 
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> > try to avoid floods of warning message for my testing linux host. If you
> > have better way, fix it anyway.
> > 
> > Below is my Linux system information and gcc version:
> > 
> > [lmwang@vpn2 ffmpeg.git]$ gcc -v
> > Using built-in specs.
> > COLLECT_GCC=gcc
> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> > Target: x86_64-redhat-linux
> > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
> > Thread model: posix
> > gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
> > [lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
> > CentOS Linux release 7.4.1708 (Core)
> > 
> > libavutil/attributes.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> > index ab2a1fd..5cb9fe3 100644
> > --- a/libavutil/attributes.h
> > +++ b/libavutil/attributes.h
> > @@ -37,7 +37,7 @@
> > #ifdef __has_builtin
> > #    define AV_HAS_BUILTIN(x) __has_builtin(x)
> > #else
> > -#    define AV_HAS_BUILTIN(x) false
> > +#    define AV_HAS_BUILTIN(x) 0
> > #endif
> 
> Please move the define to an internal header.

I'm not clear about the macro usage, so I prefer to fix the warning first.

> 
> This has to be detected in configure, I just have to find time to implement this.
> 
> Thank you, Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Hendrik Leppkes May 29, 2020, 11:27 p.m. UTC | #4
On Fri, May 29, 2020 at 11:46 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
>
>
>
> > Am 29.05.2020 um 13:18 schrieb lance.lmwang@gmail.com:
> >
> > From: Limin Wang <lance.lmwang@gmail.com>
> >
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> > try to avoid floods of warning message for my testing linux host. If you
> > have better way, fix it anyway.
> >
> > Below is my Linux system information and gcc version:
> >
> > [lmwang@vpn2 ffmpeg.git]$ gcc -v
> > Using built-in specs.
> > COLLECT_GCC=gcc
> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> > Target: x86_64-redhat-linux
> > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
> > Thread model: posix
> > gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
> > [lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
> > CentOS Linux release 7.4.1708 (Core)
> >
> > libavutil/attributes.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> > index ab2a1fd..5cb9fe3 100644
> > --- a/libavutil/attributes.h
> > +++ b/libavutil/attributes.h
> > @@ -37,7 +37,7 @@
> > #ifdef __has_builtin
> > #    define AV_HAS_BUILTIN(x) __has_builtin(x)
> > #else
> > -#    define AV_HAS_BUILTIN(x) false
> > +#    define AV_HAS_BUILTIN(x) 0
> > #endif
>
> Please move the define to an internal header.
>
> This has to be detected in configure, I just have to find time to implement this.
>

Your request is not related to a fix for these warnings. The original
patch is fine as-is, any further changes can and should be done
seperately, if there is a consensus to do them.

- Hendrik
Lance Wang May 30, 2020, 9:23 a.m. UTC | #5
On Sat, May 30, 2020 at 01:27:30AM +0200, Hendrik Leppkes wrote:
> On Fri, May 29, 2020 at 11:46 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> >
> >
> >
> >
> > > Am 29.05.2020 um 13:18 schrieb lance.lmwang@gmail.com:
> > >
> > > From: Limin Wang <lance.lmwang@gmail.com>
> > >
> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > > ---
> > > try to avoid floods of warning message for my testing linux host. If you
> > > have better way, fix it anyway.
> > >
> > > Below is my Linux system information and gcc version:
> > >
> > > [lmwang@vpn2 ffmpeg.git]$ gcc -v
> > > Using built-in specs.
> > > COLLECT_GCC=gcc
> > > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> > > Target: x86_64-redhat-linux
> > > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
> > > Thread model: posix
> > > gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
> > > [lmwang@vpn2 ffmpeg.git]$ cat /etc/centos-release
> > > CentOS Linux release 7.4.1708 (Core)
> > >
> > > libavutil/attributes.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> > > index ab2a1fd..5cb9fe3 100644
> > > --- a/libavutil/attributes.h
> > > +++ b/libavutil/attributes.h
> > > @@ -37,7 +37,7 @@
> > > #ifdef __has_builtin
> > > #    define AV_HAS_BUILTIN(x) __has_builtin(x)
> > > #else
> > > -#    define AV_HAS_BUILTIN(x) false
> > > +#    define AV_HAS_BUILTIN(x) 0
> > > #endif
> >
> > Please move the define to an internal header.
> >
> > This has to be detected in configure, I just have to find time to implement this.
> >
> 
> Your request is not related to a fix for these warnings. The original
> patch is fine as-is, any further changes can and should be done
> seperately, if there is a consensus to do them.

thanks, will apply.

> 
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index ab2a1fd..5cb9fe3 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -37,7 +37,7 @@ 
 #ifdef __has_builtin
 #    define AV_HAS_BUILTIN(x) __has_builtin(x)
 #else
-#    define AV_HAS_BUILTIN(x) false
+#    define AV_HAS_BUILTIN(x) 0
 #endif
 
 #ifndef av_always_inline