From dd2a2e7dc918c57aae3df57118042e4362377243 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 8 May 2011 16:29:51 -0700 Subject: Mark usage, fatal, and panic as _X_NORETURN xrandr.c:634:13: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'output') output->next = NULL; ~~~~~~ ^ xrandr.c:1214:6: warning: Access to field 'mode' results in a dereference of a null pointer (loaded from variable 'crtc_info') if (crtc_info->mode == None) ^~~~~~~~~ xrandr.c:1252:5: warning: Array access (via field 'outputs') results in a null pointer dereference crtc->outputs[crtc->noutput++] = output; ^ ~~~~~~~ xrandr.c:1638:33: warning: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'output_info') set_name_string (&output_name, output_info->name); ^~~~~~~~~~~ xrandr.c:1725:10: warning: Access to field 'changes' results in a dereference of a null pointer (loaded from variable 'output') if (output->changes) ^~~~~~ xrandr.c:1848:10: warning: Access to field 'mode_info' results in a dereference of a null pointer (loaded from variable 'relation') if (relation->mode_info == NULL) ^~~~~~~~ xrandr.c:3194:11: warning: Array access (from variable 'mode_shown') results in a null pointer dereference if (mode_shown[j]) continue; ^~~~~~~~~~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston --- configure.ac | 2 +- xrandr.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e4359a2..a729fc5 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CHECK_LIB(m,floor) # Checks for pkg-config packages -PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3 xrender x11) +PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3 xrender x11 xproto >= 7.0.17) AC_CONFIG_FILES([ Makefile diff --git a/xrandr.c b/xrandr.c index 558fa45..d03d3a2 100644 --- a/xrandr.c +++ b/xrandr.c @@ -88,7 +88,7 @@ static const struct { { NULL, 0 } }; -static void +static void _X_NORETURN usage(void) { fprintf(stderr, "usage: %s [options]\n", program_name); @@ -146,7 +146,7 @@ usage(void) /*NOTREACHED*/ } -static void +static void _X_NORETURN fatal (const char *format, ...) { va_list ap; @@ -1509,7 +1509,7 @@ revert (void) * the configuration. Revert to the previous configuration * and bail */ -static void +static void _X_NORETURN panic (Status s, crtc_t *crtc) { int c = crtc->crtc.index; -- cgit v1.2.3