Re: [Mesa-dev] [PATCH] m4: add Werror when checking for compiler flags
On Wednesday, 2018-10-24 11:26:56 -0700, Dylan Baker wrote: > Quoting Emil Velikov (2018-10-24 10:57:00) > > Seemingly that at some point clang started accepting _any_ flags, > > whereas previously it would error out. > > > > These days, you can give it -Whamsandwich and it will succeed, while > > at the same time throwing an annoying warning. > > > > Add -Werror so that everything gets flagged and set accordingly. > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082 > > Cc: Eric Engestrom > > Cc: Dylan Baker > > Cc: Vinson Lee > > Repored-by: Vinson Lee > > Signed-off-by: Emil Velikov > > --- > > m4/ax_check_compile_flag.m4 | 7 ++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 > > index 51df0c09a7a..0fdca907e8b 100644 > > --- a/m4/ax_check_compile_flag.m4 > > +++ b/m4/ax_check_compile_flag.m4 > > @@ -55,6 +55,11 @@ > > # modified version of the Autoconf Macro, you may extend this special > > # exception to the GPL to apply to your modified version as well. > > > > +# Emil: > > +# Toggle Werror since at some point clang started treating unknown -W > > +# flags as warnings, succeeding with the build, yet issuing an annoying > > +# warning. > > + > > #serial 3 > > > > AC_DEFUN([AX_CHECK_COMPILE_FLAG], > > @@ -62,7 +67,7 @@ AC_DEFUN([AX_CHECK_COMPILE_FLAG], > > AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl > > AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ > >ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS > > - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" > > + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 -Werror" > >AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], > > [AS_VAR_SET(CACHEVAR,[yes])], > > [AS_VAR_SET(CACHEVAR,[no])]) > > -- > > 2.19.1 > > > > This seems like the most straightforward way to solve the issue, since > otherwise > you need to track which compiler you have. Agreed; thanks for tracking it down! > > Reviewed-by: Dylan Baker Reviewed-by: Eric Engestrom ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] m4: add Werror when checking for compiler flags
Quoting Emil Velikov (2018-10-24 10:57:00) > Seemingly that at some point clang started accepting _any_ flags, > whereas previously it would error out. > > These days, you can give it -Whamsandwich and it will succeed, while > at the same time throwing an annoying warning. > > Add -Werror so that everything gets flagged and set accordingly. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082 > Cc: Eric Engestrom > Cc: Dylan Baker > Cc: Vinson Lee > Repored-by: Vinson Lee > Signed-off-by: Emil Velikov > --- > m4/ax_check_compile_flag.m4 | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 > index 51df0c09a7a..0fdca907e8b 100644 > --- a/m4/ax_check_compile_flag.m4 > +++ b/m4/ax_check_compile_flag.m4 > @@ -55,6 +55,11 @@ > # modified version of the Autoconf Macro, you may extend this special > # exception to the GPL to apply to your modified version as well. > > +# Emil: > +# Toggle Werror since at some point clang started treating unknown -W > +# flags as warnings, succeeding with the build, yet issuing an annoying > +# warning. > + > #serial 3 > > AC_DEFUN([AX_CHECK_COMPILE_FLAG], > @@ -62,7 +67,7 @@ AC_DEFUN([AX_CHECK_COMPILE_FLAG], > AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl > AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ >ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS > - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" > + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 -Werror" >AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], > [AS_VAR_SET(CACHEVAR,[yes])], > [AS_VAR_SET(CACHEVAR,[no])]) > -- > 2.19.1 > This seems like the most straightforward way to solve the issue, since otherwise you need to track which compiler you have. Reviewed-by: Dylan Baker signature.asc Description: signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] m4: add Werror when checking for compiler flags
Seemingly that at some point clang started accepting _any_ flags, whereas previously it would error out. These days, you can give it -Whamsandwich and it will succeed, while at the same time throwing an annoying warning. Add -Werror so that everything gets flagged and set accordingly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082 Cc: Eric Engestrom Cc: Dylan Baker Cc: Vinson Lee Repored-by: Vinson Lee Signed-off-by: Emil Velikov --- m4/ax_check_compile_flag.m4 | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index 51df0c09a7a..0fdca907e8b 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -55,6 +55,11 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. +# Emil: +# Toggle Werror since at some point clang started treating unknown -W +# flags as warnings, succeeding with the build, yet issuing an annoying +# warning. + #serial 3 AC_DEFUN([AX_CHECK_COMPILE_FLAG], @@ -62,7 +67,7 @@ AC_DEFUN([AX_CHECK_COMPILE_FLAG], AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 -Werror" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) -- 2.19.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev