summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-08 16:29:51 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-08 16:32:43 -0700
commitdd2a2e7dc918c57aae3df57118042e4362377243 (patch)
tree3408c9d070288af42bc4ae304e3f27916eb0ced2
parentd58d70f6781308de2f905b71a0bfcea1506b0008 (diff)
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 <jeremyhu@apple.com>
-rw-r--r--configure.ac2
-rw-r--r--xrandr.c6
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;