Mark Error as _X_NORETURN 00/9600/1
authorJeremy Huddleston <jeremyhu@apple.com>
Sun, 8 May 2011 16:48:55 +0000 (09:48 -0700)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 3 Sep 2013 04:26:16 +0000 (00:26 -0400)
xwud.c:1031:6: warning: Array access (from variable 'pixels') results in a null pointer dereference
            pixels[i] = ~0L;
            ^~~~~~
xwud.c:1036:22: warning: Array access (from variable 'pixels') results in a null pointer dereference
                if ((color.pixel = pixels[pix]) == ~0L) {
                                   ^~~~~~
xwud.c:1101:6: warning: Array access (from variable 'rpixels') results in a null pointer dereference
            rpixels[i] = ~0L;
            ^~~~~~~
xwud.c:1100:6: warning: Array access (from variable 'pixels') results in a null pointer dereference
            pixels[i] = ~0L;
            ^~~~~~

Change-Id: Ib6a427e887bfaec01d8fe27ec8aac7bba7675602
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
configure.ac
xwud.c

index 3d5da82..f370762 100644 (file)
@@ -39,7 +39,7 @@ XORG_MACROS_VERSION(1.8)
 XORG_DEFAULT_OPTIONS
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XWUD, x11)
+PKG_CHECK_MODULES(XWUD, x11 xproto >= 7.0.17)
 
 AC_CONFIG_FILES([
        Makefile
diff --git a/xwud.c b/xwud.c
index 134f062..0625f3a 100644 (file)
--- a/xwud.c
+++ b/xwud.c
@@ -70,7 +70,7 @@ static void Do_Direct(Display *dpy, XWDFileHeader *header, Colormap *colormap,
                      int ncolors, XColor *colors, 
                      XImage *in_image, XImage *out_image, XVisualInfo *vinfo);
 static unsigned int Image_Size(XImage *image);
-static void Error(char *string);
+static void Error(char *string) _X_NORETURN;
 static void _swapshort(char *bp, unsigned int n);
 static void _swaplong(char *bp, unsigned int n);
 static void DumpHeader(const XWDFileHeader *header, const char *win_name);