[Mesa-dev] [PATCH 2/2] clover: Error on incomplete switch statements

Francisco Jerez currojerez at riseup.net
Sun May 15 00:57:16 UTC 2016


Jan Vesely <jan.vesely at rutgers.edu> writes:

> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>  src/gallium/state_trackers/clover/Makefile.am | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
> index 4c9d7d9..26ebd3b 100644
> --- a/src/gallium/state_trackers/clover/Makefile.am
> +++ b/src/gallium/state_trackers/clover/Makefile.am
> @@ -1,5 +1,9 @@
>  include Makefile.sources
>  
> +AM_CXXFLAGS = -Werror=switch
> +
> +CXXFLAGS += $(AM_CXXFLAGS)
> +

I'm not much into build systems, but I don't think this is the way
you're supposed to add flags to the compiler command line, because the
user can easily override your definition inadvertently.  AFAIK the usual
idiom is to add AM_CXXFLAGS explicitly to each of the per-target
CXXFLAGS variables.  Once you do that it should be easy to remove some
redundancy between per-target CXXFLAGS (e.g. -std=c++11 and
$(VISIBILITY_CXXFLAGS)).

>  AM_CPPFLAGS = \
>  	-I$(top_srcdir)/include \
>  	-I$(top_srcdir)/src \
> -- 
> 2.5.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160514/ad47be04/attachment.sig>


More information about the mesa-dev mailing list