Bug Summary

File:test/test-eel-labeled-image.c
Warning:line 72, column 28
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-eel-labeled-image.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/test -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -I .. -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/cafe-desktop-2.0 -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/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/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/cail-3.0 -I /usr/include/libxml2 -D VERSION="1.25.0" -D BAUL_DATADIR="/usr/share/baul" -D CAFELOCALEDIR="/usr//locale" -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/test -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/2024-08-06-114458-28316-1 -x c test-eel-labeled-image.c
1#include <eel/eel-labeled-image.h>
2
3#include "test.h"
4
5static const char pixbuf_name[] = "/usr/share/pixmaps/cafe-globe.png";
6
7static void
8button_callback (CtkWidget *button,
9 gpointer callback_data)
10{
11 const char *info = callback_data;
12 g_return_if_fail (CTK_IS_BUTTON (button))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((button)); GType __t = ((ctk_button_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; })))))) { }
else { g_return_if_fail_warning (((gchar*) 0), ((const char*
) (__func__)), "CTK_IS_BUTTON (button)"); return; } } while (
0)
;
13
14 g_print ("%s(%p)\n", info, button);
15}
16
17static CtkWidget *
18labeled_image_button_window_new (const char *title,
19 GdkPixbuf *pixbuf)
20{
21 CtkWidget *window;
22 CtkWidget *vbox;
23 CtkWidget *button;
24 CtkWidget *toggle_button;
25 CtkWidget *check_button;
26 CtkWidget *plain;
27
28 window = test_window_new (title, 20);
29 vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 10);
30 ctk_container_add (CTK_CONTAINER (window)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((window)), ((ctk_container_get_type ()))))))
, vbox);
31
32 if (1) button = eel_labeled_image_button_new ("CtkButton with LabeledImage", pixbuf);
33 if (1) toggle_button = eel_labeled_image_toggle_button_new ("CtkToggleButton with LabeledImage", pixbuf);
34 if (1) check_button = eel_labeled_image_check_button_new ("CtkCheckButton with LabeledImage", pixbuf);
35 if (1) {
36 plain = eel_labeled_image_new ("Plain LabeledImage", pixbuf);
37 eel_labeled_image_set_can_focus (EEL_LABELED_IMAGE (plain)((((EelLabeledImage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((plain)), (eel_labeled_image_get_type())))))
, TRUE(!(0)));
38 }
39
40 if (button) ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((vbox)), ((ctk_box_get_type ()))))))
, button, TRUE(!(0)), TRUE(!(0)), 0);
41 if (toggle_button) ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((vbox)), ((ctk_box_get_type ()))))))
, toggle_button, TRUE(!(0)), TRUE(!(0)), 0);
42 if (check_button) ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((vbox)), ((ctk_box_get_type ()))))))
, check_button, TRUE(!(0)), TRUE(!(0)), 0);
43 if (plain) ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((vbox)), ((ctk_box_get_type ()))))))
, plain, TRUE(!(0)), TRUE(!(0)), 0);
44
45 if (button) {
46 g_signal_connect (button, "enter", G_CALLBACK (button_callback), "enter")g_signal_connect_data ((button), ("enter"), (((GCallback) (button_callback
))), ("enter"), ((void*)0), (GConnectFlags) 0)
;
47 g_signal_connect (button, "leave", G_CALLBACK (button_callback), "leave")g_signal_connect_data ((button), ("leave"), (((GCallback) (button_callback
))), ("leave"), ((void*)0), (GConnectFlags) 0)
;
48 g_signal_connect (button, "pressed", G_CALLBACK (button_callback), "pressed")g_signal_connect_data ((button), ("pressed"), (((GCallback) (
button_callback))), ("pressed"), ((void*)0), (GConnectFlags) 0
)
;
49 g_signal_connect (button, "released", G_CALLBACK (button_callback), "released")g_signal_connect_data ((button), ("released"), (((GCallback) (
button_callback))), ("released"), ((void*)0), (GConnectFlags)
0)
;
50 g_signal_connect (button, "clicked", G_CALLBACK (button_callback), "clicked")g_signal_connect_data ((button), ("clicked"), (((GCallback) (
button_callback))), ("clicked"), ((void*)0), (GConnectFlags) 0
)
;
51 }
52
53 ctk_widget_show_all (vbox);
54
55 return window;
56}
57
58int
59main (int argc, char* argv[])
60{
61 CtkWidget *labeled_image_window = NULL((void*)0);
62 CtkWidget *labeled_image_button_window = NULL((void*)0);
63 GdkPixbuf *pixbuf = NULL((void*)0);
64
65 test_init (&argc, &argv);
66
67 if (1) pixbuf = test_pixbuf_new_named (pixbuf_name, 1.0);
68 if (1) labeled_image_button_window = labeled_image_button_window_new ("LabeledImage in CtkButton Test", pixbuf);
69
70 eel_gdk_pixbuf_unref_if_not_null (pixbuf);
71
72 if (labeled_image_window) ctk_widget_show (labeled_image_window);
This statement is never executed
73 if (labeled_image_button_window) ctk_widget_show (labeled_image_button_window);
74
75 ctk_main ();
76
77 return test_quit (EXIT_SUCCESS0);
78}