xserver: Branch 'master' - 6 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Oct 4 18:57:27 UTC 2017
hw/dmx/dmx.c | 1 -
hw/dmx/examples/ev.c | 2 +-
include/meson.build | 5 ++++-
meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
test/sync/sync.c | 2 +-
5 files changed, 53 insertions(+), 7 deletions(-)
New commits:
commit db465bae533f85e7f900deb96efecc831c9d550b
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:39 2017 -0400
meson: Port default warning flags from xorg-macros
Well, almost all of them. No -Wdeclaration-after-statement because
that's legal in C99, and in the limited ways we use it, more readable.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
diff --git a/meson.build b/meson.build
index 811d3d4ce..d71cfed5a 100644
--- a/meson.build
+++ b/meson.build
@@ -14,8 +14,49 @@ add_global_arguments('-fvisibility=hidden', language : 'c')
add_global_link_arguments('-fvisibility=hidden', language : 'c')
-# Quiet some EXA warnings.
-add_global_arguments('-Wno-discarded-qualifiers', language : 'c')
+if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
+ test_wflags = [
+ '-Wall',
+ '-Wpointer-arith',
+ '-Wmissing-declarations',
+ '-Wformat=2',
+ '-Wstrict-prototypes',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wbad-function-cast',
+ '-Wold-style-definition',
+ '-Wunused',
+ '-Wuninitialized',
+ '-Wshadow',
+ '-Wmissing-noreturn',
+ '-Wmissing-format-attribute',
+ '-Wredundant-decls',
+ '-Werror=implicit',
+ '-Werror=nonnull',
+ '-Werror=init-self',
+ '-Werror=main',
+ '-Werror=missing-braces',
+ '-Werror=sequence-point',
+ '-Werror=return-type',
+ '-Werror=trigraphs',
+ '-Werror=array-bounds',
+ '-Werror=write-strings',
+ '-Werror=address',
+ '-Werror=int-to-pointer-cast',
+ '-Werror=pointer-to-int-cast',
+ ]
+else
+ test_wflags = []
+endif
+
+common_wflags = []
+foreach wflag: test_wflags
+ if cc.has_argument(wflag)
+ common_wflags += [ wflag ]
+ endif
+endforeach
+
+add_global_arguments(common_wflags, language : 'c')
xproto_dep = dependency('xproto', version: '>= 7.0.31')
randrproto_dep = dependency('randrproto', version: '>= 1.5.0')
commit 40c90ead044aa3fab79280d7a5ca5ad8e390029e
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:38 2017 -0400
meson: Check for HAVE_TYPEOF
Without this, exa's gc swap macros trigger gcc's -Wdiscarded-qualifiers.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
diff --git a/include/meson.build b/include/meson.build
index 5cea8bbcf..90f8de3cb 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -11,7 +11,10 @@ dri_dep = dependency('dri', required: build_dri2 or build_dri3)
conf_data = configuration_data()
conf_data.set('_DIX_CONFIG_H_', '1')
-
+conf_data.set('HAVE_TYPEOF', cc.compiles('''
+ int foo(int bar) { typeof(bar) baz = 1; return baz; }
+''',
+ name: 'typeof()'))
conf_data.set('MONOTONIC_CLOCK', cc.compiles('''
#define _POSIX_C_SOURCE 200112L
commit 712b02ec72b98291b78e17dcb1073a13c4a1086e
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:37 2017 -0400
meson: Default to gnu99
We don't really require all of C99, but enough that it's not worth
bothering with the distinction, especially if your toolchain is new
enough that meson is a thing for you. We could do strict C99 if we
really insisted on spelling it __typeof__, but who wants that? Nobody,
that's who.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/meson.build b/meson.build
index 26fd9a893..811d3d4ce 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,8 @@
project('xserver', 'c',
- default_options: ['buildtype=debugoptimized'],
+ default_options: [
+ 'buildtype=debugoptimized',
+ 'c_std=gnu99',
+ ],
version: '1.19.99.1',
meson_version: '>= 0.40.0',
)
commit 041f25afa81dfc7e7ef350d5b955d2d5912846c9
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:36 2017 -0400
test: const correctness fix
../test/sync/sync.c: In function ‘main’:
../test/sync/sync.c:288:40: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id);
^~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/test/sync/sync.c b/test/sync/sync.c
index f25d3fa37..bd1b0addd 100644
--- a/test/sync/sync.c
+++ b/test/sync/sync.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
{
int screen;
xcb_connection_t *c = xcb_connect(NULL, &screen);
- xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id);
+ const xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id);
if (!ext->present) {
printf("No XSync present\n");
commit 1d1ff1142a5a3904175f45d2f52bbdffb0249e57
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:35 2017 -0400
dmx: More const correctness
Fixes several dozen cases like:
../hw/dmx/examples/ev.c: In function ‘main’:
../hw/dmx/examples/ev.c:147:29: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
tmp = "X";
^
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/hw/dmx/examples/ev.c b/hw/dmx/examples/ev.c
index b70016a45..09e703ce7 100644
--- a/hw/dmx/examples/ev.c
+++ b/hw/dmx/examples/ev.c
@@ -56,7 +56,7 @@ main(int argc, char **argv)
int fd = 0;
int rc;
int i, j;
- char *tmp;
+ const char *tmp;
#define test_bit(bit) (mask[(bit)/8] & (1 << ((bit)%8)))
commit eb25facb37ef74eab83060b75f8205ce1538817f
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Sep 27 14:31:34 2017 -0400
dmx: Fix a silly redeclaration bug
../hw/dmx/dmx.c:66:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’ [-Wredundant-decls]
extern int PanoramiXNumScreens;
^~~~~~~~~~~~~~~~~~~
In file included from ../hw/dmx/dmx.c:65:0:
../Xext/panoramiXsrv.h:11:22: note: previous declaration of ‘PanoramiXNumScreens’ was here
extern _X_EXPORT int PanoramiXNumScreens;
^~~~~~~~~~~~~~~~~~~
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
index 88fe9d3d4..0ae14a21b 100644
--- a/hw/dmx/dmx.c
+++ b/hw/dmx/dmx.c
@@ -63,7 +63,6 @@
#ifdef PANORAMIX
#include "panoramiXsrv.h"
-extern int PanoramiXNumScreens;
#endif
static unsigned char DMXCode;
More information about the xorg-commit
mailing list