The rocky road to building with -Wextra
Subsystems (3)
cover The rocky road to building with -Wextra
Hi all,
A few small patches, that handle the initial step of building the whole of libdrm with WARN_CFLAGS (-Wall -Wextra and friends).
The first patch makes sure we build everything at make distcheck time, followed by a couple of warnings-turned-errors, and finally adding the cflags everywhere in the project.
Individual fixes for the 66 warnings will follow up in due time :-)
Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/4 autotools: add AM_DISTCHECK_CONFIGURE_FLAGS
To make sure that the release/distribution tarball is not broken for all the targets. Currently the experimental APIs are disabled by default amongst others.
--- Makefile.am | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Makefile.am +16 -0
@@ -22,6 +22,22 @@ include Makefile.sources ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --enable-udev \ + --enable-libkms \ + --enable-intel \ + --enable-radeon \ + --enable-nouveau \ + --enable-vmwgfx \ + --enable-omap-experimental-api \ + --enable-exynos-experimental-api \ + --enable-freedreno \ + --enable-freedreno-kgsl\ + --enable-tegra-experimental-api \ + --enable-install-test-programs \ + --enable-cairo-tests \ + --enable-manpages + pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm.pc
Signature · 6 lines
2.3.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 exynos_fimg2d_test: fix implicit funciton declaration errors
In reply to Emil VelikovAs one adds WARN_CFLAGS to the build the compiler throws a couple of lovely error messages. Add the relevant includes to fix them.
error: implicit declaration of function ‘time’
error: implicit declaration of function ‘getopt’
--- tests/exynos/exynos_fimg2d_test.c | 2 ++ 1 file changed, 2 insertions(+)
tests/exynos/exynos_fimg2d_test.c +2 -0
@@ -18,6 +18,8 @@#include <stdio.h> #include <string.h> #include <errno.h> +#include <time.h> +#include <unistd.h> #include <sys/mman.h> #include <linux/stddef.h>
Signature · 6 lines
2.3.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 tests: fix implicit funciton declaration errors
In reply to Emil Velikovioctl() and strcmp() were used without the relevent header being included.
--- tests/auth.c | 1 + tests/getclient.c | 1 + tests/getstats.c | 1 + tests/lock.c | 1 + tests/name_from_fd.c | 1 + tests/setversion.c | 1 + tests/updatedraw.c | 1 + 7 files changed, 7 insertions(+)
tests/auth.c +1 -0
@@ -26,6 +26,7 @@*/ #include <limits.h> +#include <sys/ioctl.h> #include "drmtest.h" enum auth_event {
tests/getclient.c +1 -0
@@ -26,6 +26,7 @@*/ #include <limits.h> +#include <sys/ioctl.h> #include "drmtest.h" /**
tests/getstats.c +1 -0
@@ -26,6 +26,7 @@*/ #include <limits.h> +#include <sys/ioctl.h> #include "drmtest.h" /**
tests/lock.c +1 -0
@@ -30,6 +30,7 @@*/ #include <limits.h> +#include <sys/ioctl.h> #include "drmtest.h" enum auth_event {
tests/name_from_fd.c +1 -0
@@ -28,6 +28,7 @@#include <unistd.h> #include <fcntl.h> #include <limits.h> +#include <string.h> #include "drmtest.h" /**
tests/setversion.c +1 -0
@@ -27,6 +27,7 @@#include <limits.h> #include <string.h> +#include <sys/ioctl.h> #include "drmtest.h" /**
tests/updatedraw.c +1 -0
@@ -25,6 +25,7 @@* */ +#include <sys/ioctl.h> #include "drmtest.h" static void
Signature · 6 lines
2.3.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 autotools: add WARN_CFLAGS to all targets
In reply to Emil Velikov... minus test/ttmtest. The latter is not really hooked up with the actual build.
This will give us 66 warnings on a distribution build of which
- 12 -Wunused-variable
- 11 -Wunused-function
- 19 -Wmissing-prototypes
and a few -Wswitch-enum, -Wtype-limits etc.
Adding the CFLAGS gives some exposure to these so that we can fix them.
--- Makefile.am | 1 + tests/Makefile.am | 3 ++- tests/exynos/Makefile.am | 1 + tests/kmstest/Makefile.am | 1 + tests/modeprint/Makefile.am | 1 + tests/proptest/Makefile.am | 1 + tests/radeon/Makefile.am | 1 + tests/tegra/Makefile.am | 2 +- tests/vbltest/Makefile.am | 2 ++ 9 files changed, 11 insertions(+), 2 deletions(-)
Makefile.am +1 -0
@@ -82,6 +82,7 @@ libdrm_la_LIBADD = @CLOCK_LIB@ libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm AM_CFLAGS = \ + $(WARN_CFLAGS) \ $(VALGRIND_CFLAGS) libdrm_la_SOURCES = $(LIBDRM_FILES)
tests/Makefile.am +2 -1
@@ -1,6 +1,7 @@ NULL:=# -AM_CPPFLAGS = \ +AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir)
tests/exynos/Makefile.am +1 -0
@@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir)/libkms/ \ -I $(top_srcdir)/exynos \
tests/kmstest/Makefile.am +1 -0
@@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)/libkms/ \ -I$(top_srcdir)
tests/modeprint/Makefile.am +1 -0
@@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)
tests/proptest/Makefile.am +1 -0
@@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)
tests/radeon/Makefile.am +1 -0
@@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I $(top_srcdir)/include/drm \ -I $(top_srcdir)
tests/tegra/Makefile.am +1 -1
@@ -3,7 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/tegra \ -I$(top_srcdir) -AM_CFLAGS = -Wall -Werror +AM_CFLAGS = $(WARN_CFLAGS) LDADD = \ ../../tegra/libdrm_tegra.la \
tests/vbltest/Makefile.am +2 -0
@@ -1,6 +1,8 @@ AM_CFLAGS = \ + $(WARN_CFLAGS)\ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) + if HAVE_INSTALL_TESTS bin_PROGRAMS = \ vbltest
Signature · 6 lines
2.3.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Emil Velikov
Hi all,
A few small patches, that handle the initial step of building the whole of libdrm with
WARN_CFLAGS(-Wall -Wextra and friends).The first patch makes sure we build everything at make distcheck time, followed by a couple of warnings-turned-errors, and finally adding the cflags everywhere in the project.
Individual fixes for the 66 warnings will follow up in due time :-)
Hi Jan,
Slightly forgot that you're not subscribed to the list. Considering your earlier work on this can you take a look at the series please.
This lays the groundwork, and a later one [1] nukes some of the warnings.
Thank
Emil
[1] http://lists.freedesktop.org/archives/dri-devel/2015-February/077976.html
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Jan Vesely
Reviewed-byQuoted 10 lines · Emil Velikov
Quoted 9 lines · Emil Velikov
Hi all,
A few small patches, that handle the initial step of building the whole of libdrm with
WARN_CFLAGS(-Wall -Wextra and friends).The first patch makes sure we build everything at make distcheck time, followed by a couple of warnings-turned-errors, and finally adding the cflags everywhere in the project.
Quoted 8 lines
Quoted 2 lines
Individual fixes for the 66 warnings will follow up in due time :-)
Hi Jan,
Slightly forgot that you're not subscribed to the list. Considering your earlier work on this can you take a look at the series please.
This lays the groundwork, and a later one [1] nukes some of the warnings.
Hi,
I'm now subscribed to the list, but I somehow missed the series. The changes are pretty straightforward. You can add
I'll try to find some time to take a look at the other series too.
jan
Quoted 5 lines
Thank
Emil[1] http://lists.freedesktop.org/archives/dri-devel/2015-February/077976.html
Signature · 1 line
Jan Vesely <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel