Bug Summary

File:rc/test-fade.c
Warning:line 93, column 3
This statement is never executed

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test-fade.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -I . -I . -D CAFEMENU_I_KNOW_THIS_IS_UNSTABLE -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/cafe-menus -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/cafe-menus -D PREFIX="/usr/local" -D BINDIR="/usr/local/bin" -D LIBDIR="/usr/local/lib" -D LIBEXECDIR="/usr/local/libexec" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -D CAFELOCALEDIR="/usr/local/share/locale" -D SAVERDIR="/usr/local/libexec/cafe-screensaver" -D THEMESDIR="/usr/local/share/cafe-screensaver/themes" -D CTKBUILDERDIR="/usr/local/share/cafe-screensaver" -D PAM_SERVICE_NAME="cafe-screensaver" -D G_DISABLE_ASSERT -D G_DISABLE_CHECKS -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/libxml2 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libpng16 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/libmount -I /usr/include/blkid -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2023-12-31-144134-53440-1 -x c test-fade.c
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 *
20 * Authors: William Jon McCann <mccann@jhu.edu>
21 *
22 */
23
24#include "config.h"
25
26#include <stdlib.h>
27#include <string.h>
28#include <sys/time.h>
29#include <sys/types.h>
30#include <sys/wait.h>
31#include <termios.h>
32#include <unistd.h>
33
34#include <glib/gi18n.h>
35#include <cdk/cdkx.h>
36#include <ctk/ctk.h>
37
38#include "gs-fade.h"
39#include "gs-debug.h"
40
41#ifdef HAVE_XF86VMODE_GAMMA1
42# include <X11/extensions/xf86vmode.h>
43#endif
44
45#define XF86_VIDMODE_NAME"XFree86-VidModeExtension" "XFree86-VidModeExtension"
46
47static void
48test_fade (void)
49{
50 GSFade *fade;
51 int reps = 2;
52 int delay = 2;
53
54 fade = gs_fade_new ();
55
56 while (reps-- > 0)
57 {
58
59 g_print ("fading out...");
60 gs_fade_sync (fade, 1000);
61 g_print ("done.\n");
62
63 g_print ("fading in...");
64 gs_fade_reset (fade);
65 g_print ("done.\n");
66
67 if (delay)
68 {
69 sleep (delay);
70 }
71 }
72
73 g_object_unref (fade);
74}
75
76int
77main (int argc,
78 char **argv)
79{
80 GError *error = NULL((void*)0);
81 int op, event, err;
82
83#ifdef ENABLE_NLS1
84 bindtextdomain (GETTEXT_PACKAGE"cafe-screensaver", CAFELOCALEDIR"/usr/local/share/locale");
85# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
86 bind_textdomain_codeset (GETTEXT_PACKAGE"cafe-screensaver", "UTF-8");
87# endif
88 textdomain (GETTEXT_PACKAGE"cafe-screensaver");
89#endif
90
91 if (error)
92 {
93 fprintf (stderrstderr, "%s\n", error->message);
This statement is never executed
94 exit (1);
95 }
96
97 if (! ctk_init_with_args (&argc, &argv, NULL((void*)0), NULL((void*)0), NULL((void*)0), &error))
98 {
99 fprintf (stderrstderr, "%s", error->message);
100 g_error_free (error);
101 exit (1);
102 }
103
104 if (! XQueryExtension (CDK_DISPLAY_XDISPLAY (cdk_display_get_default ())(cdk_x11_display_get_xdisplay (cdk_display_get_default ())), XF86_VIDMODE_NAME"XFree86-VidModeExtension", &op, &event, &err))
105 {
106 g_message ("no " XF86_VIDMODE_NAME"XFree86-VidModeExtension" " extension");
107 }
108 else
109 {
110# ifdef HAVE_XF86VMODE_GAMMA1
111 int major;
112 int minor;
113
114 if (! XF86VidModeQueryVersion (CDK_DISPLAY_XDISPLAY (cdk_display_get_default ())(cdk_x11_display_get_xdisplay (cdk_display_get_default ())), &major, &minor))
115 {
116 g_message ("unable to get " XF86_VIDMODE_NAME"XFree86-VidModeExtension" " version");
117 }
118 else
119 {
120 g_message (XF86_VIDMODE_NAME"XFree86-VidModeExtension" " version %d.%d", major, minor);
121 }
122# else /* !HAVE_XF86VMODE_GAMMA */
123 g_message ("no support for display's " XF86_VIDMODE_NAME"XFree86-VidModeExtension" " extension");
124# endif /* !HAVE_XF86VMODE_GAMMA */
125 }
126
127 gs_debug_init (TRUE(!(0)), FALSE(0));
128
129 test_fade ();
130
131 gs_debug_shutdown ();
132
133 return 0;
134}