Skip to contentSkip to conversation

benchmarks/, overlay/, demos/, tools/, tests/: Add Werror by default.

PATCH In review Marius Vlad 3 participants 7 messages May 9, 2016 – May 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 benchmarks/, overlay/, demos/, tools/, tests/: Add Werror by default.

Easier to catch compilation errors.

---
 benchmarks/Makefile.am | 2 +-
 demos/Makefile.am      | 3 ++-
 overlay/Makefile.am    | 3 ++-
 tests/Makefile.am      | 2 +-
 tools/Makefile.am      | 4 +++-
 5 files changed, 9 insertions(+), 5 deletions(-)
benchmarks/Makefile.am +1 -1
index 2c2d100..46992f8 100644
@@ -2,7 +2,7 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
demos/Makefile.am +2 -1
index e6fbb3b..9eacd16 100644
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	    $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am +2 -1
index c648875..ec68489 100644
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
 endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	$(OVERLAY_CFLAGS) -Werror
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
 
 intel_gpu_overlay_SOURCES = \
tests/Makefile.am +1 -1
index 45e3359..22256ce 100644
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) -Werror \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
tools/Makefile.am +3 -1
index df48d94..0ba1ff7 100644
@@ -3,7 +3,9 @@ include Makefile.sources
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \
+	    $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    -DPKGDATADIR=\"$(pkgdatadir)\" -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
Signature · 6 lines
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 1 line · Marius Vlad

Easier to catch compilation errors.

Having -Werror by default is a no go as you cannot control/predict the set of warnings (and the quality of those) of all previous and future gcc/clang versions.

Always using this flag will cause distributions to hate us.

Adding a test (with patchwork integration!) that ensures each commit posted on this mailing-list compiles without new warning with a chosen toolchain (and even passes distcheck!) would be nice.

Signature · 1 line
Damien
Quoted 83 lines
---
 benchmarks/Makefile.am | 2 +-
 demos/Makefile.am      | 3 ++-
 overlay/Makefile.am    | 3 ++-
 tests/Makefile.am      | 2 +-
 tools/Makefile.am      | 4 +++-
 5 files changed, 9 insertions(+), 5 deletions(-)
benchmarks/Makefile.am +1 -1
index 2c2d100..46992f8 100644
@@ -2,7 +2,7 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
demos/Makefile.am +2 -1
index e6fbb3b..9eacd16 100644
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	    $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am +2 -1
index c648875..ec68489 100644
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
 endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	$(OVERLAY_CFLAGS) -Werror
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
 
 intel_gpu_overlay_SOURCES = \
tests/Makefile.am +1 -1
index 45e3359..22256ce 100644
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) -Werror \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
tools/Makefile.am +3 -1
index df48d94..0ba1ff7 100644
@@ -3,7 +3,9 @@ include Makefile.sources
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \
+	    $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    -DPKGDATADIR=\"$(pkgdatadir)\" -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
Signature · 6 lines
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 9 lines · Damien Lespiau
Quoted 1 line · Marius Vlad

Easier to catch compilation errors.

Having -Werror by default is a no go as you cannot control/predict the set of warnings (and the quality of those) of all previous and future gcc/clang versions.

Always using this flag will cause distributions to hate us.

I assumed that much.

Quoted 4 lines

Adding a test (with patchwork integration!) that ensures each commit posted on this mailing-list compiles without new warning with a chosen toolchain (and even passes distcheck!) would be nice.

We have this for check and distcheck internally. The whole point of Werror was to catch warnings as well when building, and letting us know so we can fix it. The problem is (unfortunately) that not all patches arrive thru m-l. Don't really know how much traction some CI/buildbot for i-g-t will have.

Quoted 87 lines
Signature · 2 lines
-- 
Damien
Quoted 83 lines
---
 benchmarks/Makefile.am | 2 +-
 demos/Makefile.am      | 3 ++-
 overlay/Makefile.am    | 3 ++-
 tests/Makefile.am      | 2 +-
 tools/Makefile.am      | 4 +++-
 5 files changed, 9 insertions(+), 5 deletions(-)
benchmarks/Makefile.am +1 -1
index 2c2d100..46992f8 100644
@@ -2,7 +2,7 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
demos/Makefile.am +2 -1
index e6fbb3b..9eacd16 100644
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	    $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am +2 -1
index c648875..ec68489 100644
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
 endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	$(OVERLAY_CFLAGS) -Werror
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
 
 intel_gpu_overlay_SOURCES = \
tests/Makefile.am +1 -1
index 45e3359..22256ce 100644
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) -Werror \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
tools/Makefile.am +3 -1
index df48d94..0ba1ff7 100644
@@ -3,7 +3,9 @@ include Makefile.sources
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \
+	    $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    -DPKGDATADIR=\"$(pkgdatadir)\" -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
Signature · 6 lines
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 8 lines · Marius Vlad
Quoted 3 lines

Adding a test (with patchwork integration!) that ensures each commit posted on this mailing-list compiles without new warning with a chosen toolchain (and even passes distcheck!) would be nice.

We have this for check and distcheck internally. The whole point of Werror was to catch warnings as well when building, and letting us know so we can fix it. The problem is (unfortunately) that not all patches arrive thru m-l. Don't really know how much traction some CI/buildbot for i-g-t will have.

Oh, CI for i-g-t patches is a must have and on the roadmap. Can't really keep on testing kernel patches if we can just regress everything with random i-g-t patches.

Doing the distcheck for every patch on the ml would already be a nice thing.

Alternatively, you could have an --enable-werror configure flag developers may wish to use.

Signature · 5 lines
Damien
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Marius Vlad
Quoted 15 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On
Behalf Of Marius Vlad
Sent: Monday, May 9, 2016 4:55 PM
To: Lespiau, Damien <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [Intel-gfx] [PATCH i-g-t] benchmarks/, overlay/, demos/, tools/, tests/: Add Werror by default.

Quoted 4 lines · Damien Lespiau
Quoted 1 line · Marius Vlad

Easier to catch compilation errors.

Quoted 6 lines
Quoted 5 lines

Having -Werror by default is a no go as you cannot control/predict the set of warnings (and the quality of those) of all previous and future gcc/clang versions.

Always using this flag will cause distributions to hate us.

I assumed that much.

Building IGT for android generates large numbers of warnings as the compiler used for android is more paranoid. If you make all warnings errors you would have to also fix a lot of warnings for android.

Quoted 89 lines
Quoted 5 lines

Adding a test (with patchwork integration!) that ensures each commit posted on this mailing-list compiles without new warning with a chosen toolchain (and even passes distcheck!) would be nice.

We have this for check and distcheck internally. The whole point of Werror was to catch warnings as well when building, and letting us know so we can fix it. The problem is (unfortunately) that not all patches arrive thru m-l. Don't really know how much traction some CI/buildbot for i-g-t will have.

Quoted 83 lines

--
Damien

Quoted 79 lines
---
 benchmarks/Makefile.am | 2 +-
 demos/Makefile.am      | 3 ++-
 overlay/Makefile.am    | 3 ++-
 tests/Makefile.am      | 2 +-
 tools/Makefile.am      | 4 +++-
 5 files changed, 9 insertions(+), 5 deletions(-)
benchmarks/Makefile.am index renamed from benchmarks/Makefile.am +0 -0

2c2d100..46992f8 100644

benchmarks/Makefile.am +2 -0
@@ -2,7 +2,7 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS =
 $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS)
+$(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la diff --git 

a/demos/Makefile.am b/demos/Makefile.am index e6fbb3b..9eacd16 100644

demos/Makefile.am +2 -0
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS =
 $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS)
 $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	    $(LIBUNWIND_CFLAGS) -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am index renamed from overlay/Makefile.am +0 -0

c648875..ec68489 100644

overlay/Makefile.am +2 -1
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay  endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS)
 $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) \
+	$(OVERLAY_CFLAGS) -Werror
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) 
 $(OVERLAY_LIBS)
 

intel_gpu_overlay_SOURCES = \

tests/Makefile.am index renamed from tests/Makefile.am +0 -0

45e3359..22256ce 100644

tests/Makefile.am +1 -1
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) -Werror \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS) diff --git 

a/tools/Makefile.am b/tools/Makefile.am index df48d94..0ba1ff7 100644

tools/Makefile.am +0 -0
@@ -3,7 +3,9 @@ include Makefile.sources  SUBDIRS = null_state_gen 

registers

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS =
$(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"

tools/Makefile.am +3 -0
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \
+	    $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    -DPKGDATADIR=\"$(pkgdatadir)\" -Werror
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines

--
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

PATCH 1/1 benchmarks/, overlay/, demos/, tools/, tests/: Add optional Werror.

In reply to Marius Vlad

v2: Initially added Werror by default. Make it optional so it doesn't break android build and (potential) distros maintaing the package (Hinted by Damien Lespiau).

--enable-werror will enable -Werror compiler flag.

---
 benchmarks/Makefile.am |  3 ++-
 configure.ac           | 10 ++++++++++
 demos/Makefile.am      |  3 ++-
 overlay/Makefile.am    |  3 ++-
 tests/Makefile.am      |  2 +-
 tools/Makefile.am      |  4 +++-
 6 files changed, 20 insertions(+), 5 deletions(-)
benchmarks/Makefile.am +2 -1
index 2c2d100..49d2f64 100644
@@ -2,7 +2,8 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
configure.ac +10 -0
index 0589782..11b1d46 100644
@@ -229,6 +229,11 @@ AC_ARG_ENABLE(debug,
 			     [Build tests without debug symbols]),
 	      [], [enable_debug=yes])
 
+AC_ARG_ENABLE(werror,
+	      AS_HELP_STRING([--enable-werror],
+			     [Fail on warnings]),
+	      [], [enable_werror=no])
+
 if test "x$enable_debug" = xyes; then
 	AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
 	AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
@@ -236,6 +241,10 @@ if test "x$enable_debug" = xyes; then
 	AC_SUBST([DEBUG_CFLAGS])
 fi
 
+if test "x$enable_werror" = xyes; then
+	AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"])
+fi
+
 # prevent relinking the world on every commit for developers
 AC_ARG_ENABLE(git-hash,
 	      AS_HELP_STRING([--disable-git-hash],
@@ -313,6 +322,7 @@ echo "       Overlay            : X: ${enable_overlay_xlib}, Xv: ${enable_overla
 echo "       x86-specific tools : ${build_x86}"
 echo ""
 echo " • API-Documentation      : ${enable_gtk_doc}"
+echo " • Fail on warnings:      : ${enable_werror}"
 echo ""
 
 # vim: set ft=config ts=8 sw=8 tw=0 noet :
demos/Makefile.am +2 -1
index e6fbb3b..f5725f4 100644
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am +2 -1
index c648875..c926557 100644
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
 endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	$(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS)
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
 
 intel_gpu_overlay_SOURCES = \
tests/Makefile.am +1 -1
index 45e3359..32b9115 100644
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
tools/Makefile.am +3 -1
index df48d94..5f45144 100644
@@ -3,7 +3,9 @@ include Makefile.sources
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \
+	    $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
Signature · 6 lines
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 1/1
#6 lore raw

Re: [PATCH i-g-t] benchmarks/, overlay/, demos/, tools/, tests/: Add optional Werror.

Quoted 7 lines · Marius Vlad

v2: Initially added Werror by default. Make it optional so it doesn't break android build and (potential) distros maintaing the package (Hinted by Damien Lespiau).

--enable-werror will enable -Werror compiler flag.

Looks like some people might want to use this:

Signature · 1 line
Damien
Quoted 115 lines
---
 benchmarks/Makefile.am |  3 ++-
 configure.ac           | 10 ++++++++++
 demos/Makefile.am      |  3 ++-
 overlay/Makefile.am    |  3 ++-
 tests/Makefile.am      |  2 +-
 tools/Makefile.am      |  4 +++-
 6 files changed, 20 insertions(+), 5 deletions(-)
benchmarks/Makefile.am +2 -1
index 2c2d100..49d2f64 100644
@@ -2,7 +2,8 @@
 include Makefile.sources
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
configure.ac +10 -0
index 0589782..11b1d46 100644
@@ -229,6 +229,11 @@ AC_ARG_ENABLE(debug,
 			     [Build tests without debug symbols]),
 	      [], [enable_debug=yes])
 
+AC_ARG_ENABLE(werror,
+	      AS_HELP_STRING([--enable-werror],
+			     [Fail on warnings]),
+	      [], [enable_werror=no])
+
 if test "x$enable_debug" = xyes; then
 	AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
 	AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
@@ -236,6 +241,10 @@ if test "x$enable_debug" = xyes; then
 	AC_SUBST([DEBUG_CFLAGS])
 fi
 
+if test "x$enable_werror" = xyes; then
+	AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"])
+fi
+
 # prevent relinking the world on every commit for developers
 AC_ARG_ENABLE(git-hash,
 	      AS_HELP_STRING([--disable-git-hash],
@@ -313,6 +322,7 @@ echo "       Overlay            : X: ${enable_overlay_xlib}, Xv: ${enable_overla
 echo "       x86-specific tools : ${build_x86}"
 echo ""
 echo " • API-Documentation      : ${enable_gtk_doc}"
+echo " • Fail on warnings:      : ${enable_werror}"
 echo ""
 
 # vim: set ft=config ts=8 sw=8 tw=0 noet :
demos/Makefile.am +2 -1
index e6fbb3b..f5725f4 100644
@@ -3,5 +3,6 @@ bin_PROGRAMS = 				\
 	$(NULL)
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
overlay/Makefile.am +2 -1
index c648875..c926557 100644
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
 endif
 
 AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	$(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS)
 LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
 
 intel_gpu_overlay_SOURCES = \
tests/Makefile.am +1 -1
index 45e3359..32b9115 100644
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
-	$(LIBUNWIND_CFLAGS) \
+	$(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
 	$(NULL)
 
 LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
tools/Makefile.am +3 -1
index df48d94..5f45144 100644
@@ -3,7 +3,9 @@ include Makefile.sources
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \
+	    $(WERROR_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
Signature · 1 line
2.8.0.rc3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx