[Mesa-dev] [PATCH 2/2] libdrm: more compile warning fixes
Jan Engelhardt
jengelh at inai.de
Sun Jul 8 18:46:34 PDT 2012
rpmlint says:
I: Program returns random data in a function
E: libdrm no-return-in-nonvoid-function modetest.c:162, 143
---
0001.diff | 30 ++++++++++++++++++++++++++++++
tests/modetest/modetest.c | 2 +-
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100644 0001.diff
diff --git a/0001.diff b/0001.diff
new file mode 100644
index 0000000..697d30c
--- /dev/null
+++ b/0001.diff
@@ -0,0 +1,30 @@
+parent 881e69f185d2450ca35964caf254b04e7e8838c1 (libdrm-2.4.37-2-g881e69f)
+commit 8726f476118b0c97fdcee6866df1f6575b879cb3
+Author: Jan Engelhardt <jengelh at inai.de>
+Date: Mon Jul 9 03:20:16 2012 +0200
+
+libdrm: fix compile warning
+
+xf86drmSL.c:273:8: warning: 'update[0]' is used uninitialized in this function [-Wuninitialized]
+
+I have no idea what to really do here. The code is essentially unused
+because update[0] is always NULL.
+---
+ xf86drmSL.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/xf86drmSL.c b/xf86drmSL.c
+index acddb54..94be22f 100644
+--- a/xf86drmSL.c
++++ b/xf86drmSL.c
+@@ -264,7 +264,7 @@ int drmSLLookupNeighbors(void *l, unsigned long key,
+ unsigned long *next_key, void **next_value)
+ {
+ SkipListPtr list = (SkipListPtr)l;
+- SLEntryPtr update[SL_MAX_LEVEL + 1];
++ SLEntryPtr update[SL_MAX_LEVEL + 1] = {0};
+ int retcode = 0;
+
+ *prev_key = *next_key = key;
+--
+# Created with git-export-patch
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ec3121e..28a3a5c 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -119,7 +119,7 @@ struct type_name connector_type_names[] = {
type_name_fn(connector_type)
#define bit_name_fn(res) \
-char * res##_str(int type) { \
+void res##_str(int type) { \
int i; \
const char *sep = ""; \
for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
--
1.7.7
More information about the mesa-dev
mailing list