On Wed, Feb 12, 2014 at 11:00 AM, Egbert Eich <e...@freedesktop.org> wrote:
> From: Egbert Eich <e...@suse.com>
>
> With '-Wformat-nonliteral' gcc kindly arns us that it cannot check the
> arguments of a scanf statement as the format string is not literal.
> Here in this code this is done for a reason though thus we disable the
> warning for the code in question.
>
> Signed-off-by: Egbert Eich <e...@suse.com>
> ---
>  src/Makefile.am  |  5 +++++
>  src/common.mk    |  4 +++-
>  test/Makefile.am | 14 +++++++++-----
>  3 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index b9fecc6..095d7e1 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am

I think I'd prefer using `#pragma GCC diagnostic` around the two
problematic lines to surgically stop the warnings. There's no need to
disable the check for the entirety of wcmISDV4.c, and mucking with the
build system to achive the result seems like using a hammer to drive a
screw.

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one  /
(That is to say, eight) to the two,     /
But you can’t take seven from three,    /
So you look at the sixty-fours....

> @@ -35,3 +35,8 @@ AM_CPPFLAGS=-I$(top_srcdir)/include/
>  AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(UDEV_CFLAGS)
>
>  @DRIVER_NAME@_drv_la_SOURCES = $(DRIVER_SOURCES)
> +
> +@DRIVER_NAME@_drv_la_LIBADD = libtmp.la
> +noinst_LTLIBRARIES = libtmp.la
> +libtmp_la_SOURCES = $(OTHER_SOURCES)
> +libtmp_la_CFLAGS = $(AM_CFLAGS) -Wformat=1
> diff --git a/src/common.mk b/src/common.mk
> index 7f1eadd..42249fe 100644
> --- a/src/common.mk
> +++ b/src/common.mk
> @@ -5,7 +5,6 @@ DRIVER_SOURCES= \
>         $(top_srcdir)/src/xf86Wacom.h \
>         $(top_srcdir)/src/wcmCommon.c \
>         $(top_srcdir)/src/wcmConfig.c \
> -       $(top_srcdir)/src/wcmISDV4.c \
>         $(top_srcdir)/src/wcmFilter.c \
>         $(top_srcdir)/src/wcmFilter.h \
>         $(top_srcdir)/src/xf86WacomDefs.h \
> @@ -14,3 +13,6 @@ DRIVER_SOURCES= \
>         $(top_srcdir)/src/wcmValidateDevice.c \
>         $(top_srcdir)/src/wcmTouchFilter.c \
>         $(top_srcdir)/src/wcmTouchFilter.h
> +
> +OTHER_SOURCES = \
> +       $(top_srcdir)/src/wcmISDV4.c
> diff --git a/test/Makefile.am b/test/Makefile.am
> index d16dca8..143be31 100644
> --- a/test/Makefile.am
> +++ b/test/Makefile.am
> @@ -2,18 +2,22 @@ if UNITTESTS
>  include ../src/common.mk
>
>  check_PROGRAMS = wacom-tests
> -check_LTLIBRARIES = libwacom-test.la
> -libwacom_test_la_SOURCES =$(DRIVER_SOURCES)
> -libwacom_test_la_CFLAGS = -DUNIT_TESTS -I$(top_srcdir)/src $(XORG_CFLAGS) 
> $(CWARNFLAGS) -fvisibility=default
> +check_LTLIBRARIES = libwacom-test-1.la libwacom-test-2.la
> +libwacom_test_1_la_SOURCES =$(DRIVER_SOURCES)
> +libwacom_test_1_la_CFLAGS = -DUNIT_TESTS -I$(top_srcdir)/src $(XORG_CFLAGS) 
> $(CWARNFLAGS) -fvisibility=default
> +
> +libwacom_test_2_la_SOURCES =$(OTHER_SOURCES)
> +libwacom_test_2_la_CFLAGS = -DUNIT_TESTS -I$(top_srcdir)/src $(XORG_CFLAGS) 
> $(CWARNFLAGS) -fvisibility=default -Wformat=1
>
>  TESTS=$(check_PROGRAMS)
>
>  AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include
>  AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(UDEV_CFLAGS)
> -TEST_LDADD= libwacom-test.la
> +TEST_1_LDADD= libwacom-test-1.la
> +TEST_2_LDADD= libwacom-test-2.la
>  COMMON_SOURCES=fake-symbols.c fake-symbols.h
>
> -wacom_tests_LDADD=$(TEST_LDADD) $(UDEV_LIBS)
> +wacom_tests_LDADD=$(TEST_1_LDADD) $(TEST_2_LDADD) $(UDEV_LIBS)
>  wacom_tests_CFLAGS=  -DUNIT_TESTS $(AM_CFLAGS)
>  wacom_tests_SOURCES=wacom-tests.c $(COMMON_SOURCES)
>
> --
> 1.8.1.4
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to