Clang/scan-build display warnings
Submitted by Paul Menzel
Link to original bug (#744504)
Description
Building master at commit 1721403c (correct ShowLocalGreeter (standalone XDMCP server)), scan-build 3.6, the Clang static analyzer, shows the following warnings, most of them set but unused variables.
$ scan-build-3.6 -o sb make -j4
scan-build: Using '/usr/lib/llvm-3.6/bin/clang' for static analysis
make all-recursive
make[1]: Entering directory '/mnt/gdm'
Making all in data
make[2]: Entering directory '/mnt/gdm/data'
Making all in applications
make[3]: Entering directory '/mnt/gdm/data/applications'
ITMRG gnome-shell.desktop
make[3]: Leaving directory '/mnt/gdm/data/applications'
Making all in autostart
make[3]: Entering directory '/mnt/gdm/data/autostart'
GEN caribou-autostart.desktop
make[3]: Leaving directory '/mnt/gdm/data/autostart'
Making all in pixmaps
make[3]: Entering directory '/mnt/gdm/data/pixmaps'
Making all in 16x16
make[4]: Entering directory '/mnt/gdm/data/pixmaps/16x16'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/gdm/data/pixmaps/16x16'
Making all in 32x32
make[4]: Entering directory '/mnt/gdm/data/pixmaps/32x32'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/gdm/data/pixmaps/32x32'
Making all in 48x48
make[4]: Entering directory '/mnt/gdm/data/pixmaps/48x48'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/gdm/data/pixmaps/48x48'
make[4]: Entering directory '/mnt/gdm/data/pixmaps'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/mnt/gdm/data/pixmaps'
make[3]: Leaving directory '/mnt/gdm/data/pixmaps'
make[3]: Entering directory '/mnt/gdm/data'
GEN greeter-dconf-defaults
sed -e 's,[@]GDMPREFETCHCMD[@],,g'
-e 's,[@]GDM_CUSTOM_CONF[@],/usr/local/etc/gdm/custom.conf,g'
-e 's,[@]GDM_USER_PATH[@],,g'
-e 's,[@]GDM_USERNAME[@],gdm,g'
-e 's,[@]GDM_GROUPNAME[@],gdm,g'
-e 's,[@]HALT_COMMAND[@],,g'
-e 's,[@]REBOOT_COMMAND[@],,g'
-e 's,[@]SOUND_PROGRAM[@],,g'
-e 's,[@]SUSPEND_COMMAND[@],,g'
-e 's,[@]XEVIE_OPTION[@],,g'
-e 's,[@]ALWAYS_RESTART_SERVER[@],,g'
-e 's,[@]X_CONFIG_OPTIONS[@],,g'
-e 's,[@]X_SERVER[@],/usr/bin/Xorg,g'
-e 's,[@]X_XNEST_CMD[@],/usr/bin/Xephyr,g'
-e 's,[@]X_XNEST_CONFIG_OPTIONS[@],-audit 0,g'
-e 's,[@]X_XNEST_UNSCALED_FONTPATH[@],true,g'
-e 's,[@]GDM_RBAC_SYSCMD_KEYS[@],,g'
-e 's,[@]datadir[@],/usr/local/share,g'
-e 's,[@]gdmconfdir[@],/usr/local/etc/gdm,g'
-e 's,[@]libdir[@],/usr/local/lib,g'
-e 's,[@]libexecdir[@],/usr/local/libexec,g'
-e 's,[@]gdmlocaledir[@],/usr/local/etc/gdm,g'
-e 's,[@]logdir[@],/var/log/gdm,g'
-e 's,[@]pixmapdir[@],/usr/local/share/pixmaps,g'
-e 's,[@]sbindir[@],/usr/local/sbin,g'
<./gdm.schemas.in.in >gdm.schemas.in
sed -e 's,[@]libexecdir[@],/usr/local/libexec,g'
-e 's,[@]CHECK_ACCELERATED_DIR[@],/usr/local/libexec,g'
< gdm-shell.session.in > gdm-shell.session.tmp && mv gdm-shell.session.tmp gdm-shell.session
ITMRG org.gnome.login-screen.gschema.xml
ITMRG gdm.schemas
GEN org.gnome.login-screen.gschema.valid
make[3]: Leaving directory '/mnt/gdm/data'
make[2]: Leaving directory '/mnt/gdm/data'
Making all in common
make[2]: Entering directory '/mnt/gdm/common'
CC libgdmcommon_la-gdm-common.lo
CC libgdmcommon_la-gdm-settings.lo
CC libgdmcommon_la-gdm-address.lo
CC libgdmcommon_la-gdm-profile.lo
CC libgdmcommon_la-gdm-settings-backend.lo
gdm-common.c:432:17: warning: Value stored to 'res' is never read
res = get_seat_id_for_session (connection, session_id, &seat_id);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdm-common.c:730:17: warning: Value stored to 'ret' is never read
ret = TRUE;
^ ~~~~
gdm-common.c:739:21: warning: Array access (from variable 'sessions') results in a null pointer dereference
for (i = 0; sessions[i]; i ++) {
^~~~~~~~~~~
3 warnings generated.
CC libgdmcommon_la-gdm-settings-desktop-backend.lo
CC libgdmcommon_la-gdm-settings-utils.lo
CC libgdmcommon_la-gdm-settings-direct.lo
gdm-settings-direct.c:111:9: warning: Value stored to 'ret' is never read
ret = FALSE;
^ ~~~~~
gdm-settings-direct.c:134:9: warning: Value stored to 'ret' is never read
ret = FALSE;
^ ~~~~~
gdm-settings-direct.c:161:9: warning: Value stored to 'ret' is never read
ret = FALSE;
^ ~~~~~
3 warnings generated.
CC libgdmcommon_la-gdm-log.lo
CC test-log.o
CCLD libgdmcommon.la
CCLD test-log
make[2]: Leaving directory '/mnt/gdm/common'
Making all in daemon
make[2]: Entering directory '/mnt/gdm/daemon'
GEN gdm-manager-glue.h
GEN gdm-static-display-glue.h
GEN gdm-display-glue.h
GEN gdm-transient-display-glue.h
GEN gdm-local-display-factory-glue.h
GEN gdm-session-glue.h
GEN gdm-session-worker-glue.h
GEN gdm-session-enum-types.h
make all-am
make[3]: Entering directory '/mnt/gdm/daemon'
CC gdm-session.o
CC gdm-session-auditor.o
CC gdm-session-settings.o
CC session-worker-main.o
CC gdm-session-record.o
CC gdm-session-worker.o
CC gdm-session-worker-job.o
CC gdm-session-worker-common.o
CC gdm-dbus-util.o
gdm-session-worker-job.c:263:9: warning: Value stored to 'ret' is never read
ret = FALSE;
^ ~~~~~
1 warning generated.
CC gdm-session-linux-auditor.o
CC gdm-session-glue.o
CC gdm-session-worker-glue.o
GEN gdm-session-enum-types.c
CC test-session-client.o
CC gdm-manager-glue.o
gdm-session-worker.c:777:9: warning: Value stored to 'res' is never read
res = FALSE;
^ ~~~~~
gdm-session-worker.c:919:9: warning: Potential leak of memory pointed to by 'replies'
g_debug ("GdmSessionWorker: PAM conversation returning %d: %s",
^~~~~~~
gdm-session-worker.c:1088:22: warning: Null pointer passed as an argument to a 'nonnull' parameter
error_code = pam_start (service,
^~~~~~~~~~~~~~~~~~~
gdm-session-worker.c:1383:9: warning: Value stored to 'aux_buffer_size' is never read
aux_buffer_size = 0;
^ ~
gdm-session-worker.c:2036:9: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
5 warnings generated.
CC main.o
CC gdm-display-access-file.o
CC gdm-display-store.o
CC gdm-display-factory.o
CC gdm-local-display-factory.o
CC gdm-display.o
gdm-display-access-file.c:284:21: warning: Function call argument is an uninitialized value
if (chown (GDM_XAUTH_DIR, 0, gid) != 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
CC gdm-static-display.o
CC gdm-transient-display.o
CC gdm-launch-environment.o
CC gdm-manager.o
CC gdm-server.o
gdm-display.c:171:73: warning: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
g_critical ("could not create display access file: %s", error->message);
^~~~~~~~~~~~~~
gdm-display.c:374:9: warning: Access to field 'get_timed_login_details' results in a dereference of a null pointer (loaded from field 'g_class')
GDM_DISPLAY_GET_CLASS (display)->get_timed_login_details (display, &enabled, &username, &delay);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gdm-display.h:36:34: note: expanded from macro 'GDM_DISPLAY_GET_CLASS'
#define GDM_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_DISPLAY, GdmDisplayClass))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
CC gdm-slave.o
gdm-slave.c:234:9: warning: Value stored to 'ret' is never read
ret = FALSE;
^ ~~~~~
1 warning generated.
CC gdm-simple-slave.o
CC gdm-xerrors.o
CC gdm-xdmcp-display-factory.o
gdm-server.c:741:13: warning: Dereference of undefined pointer value
if (argv[0] == NULL) {
^~~~~~~
1 warning generated.
CC gdm-xdmcp-display.o
CC gdm-xdmcp-greeter-display.o
CC gdm-xdmcp-chooser-display.o
CC gdm-xdmcp-chooser-slave.o
CC gdm-display-glue.o
gdm-manager.c:951:17: warning: Value stored to 'error' is never read
error = g_error_new (G_DBUS_ERROR,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
gdm-manager.c:960:17: warning: Value stored to 'error' is never read
error = g_error_new (G_DBUS_ERROR,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
CC gdm-local-display-factory-glue.o
CC gdm-transient-display-glue.o
CC gdm-static-display-glue.o
CC gdm-session-enum-types.o
CCLD test-session-client
CCLD gdm-session-worker
CCLD gdm
make[3]: Leaving directory '/mnt/gdm/daemon'
make[2]: Leaving directory '/mnt/gdm/daemon'
Making all in libgdm
make[2]: Entering directory '/mnt/gdm/libgdm'
GEN gdm-manager-glue.h
GEN gdm-client-glue.h
make all-am
make[3]: Entering directory '/mnt/gdm/libgdm'
CC libgdm_la-gdm-client.lo
CC libgdm_la-gdm-sessions.lo
CC libgdm_la-gdm-user-switching.lo
CC libgdm_la-gdm-client-glue.lo
CC libgdm_la-gdm-manager-glue.lo
gdm-user-switching.c:156:17: warning: Value stored to 'res' is never read
res = get_seat_id_for_session (connection, session_id, &seat_id);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
CCLD libgdm.la
GISCAN Gdm-1.0.gir
GICOMP Gdm-1.0.gir
make[3]: Leaving directory '/mnt/gdm/libgdm'
make[2]: Leaving directory '/mnt/gdm/libgdm'
Making all in gui
make[2]: Entering directory '/mnt/gdm/gui'
Making all in simple-chooser
make[3]: Entering directory '/mnt/gdm/gui/simple-chooser'
CC chooser-main.o
CC gdm-chooser-host.o
CC gdm-host-chooser-dialog.o
CC gdm-host-chooser-widget.o
gdm-host-chooser-widget.c: In function ‘gdm_host_chooser_widget_get_type’:
gdm-host-chooser-widget.c:93:1: warning: ‘gtk_vbox_get_type’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkvbox.h:59) [-Wdeprecated-declarations]
G_DEFINE_TYPE (GdmHostChooserWidget, gdm_host_chooser_widget, GTK_TYPE_VBOX)
^
gdm-host-chooser-dialog.c: In function ‘gdm_host_chooser_dialog_constructor’:
gdm-host-chooser-dialog.c:140:33: warning: ‘GtkStock’ is deprecated [-Wdeprecated-declarations]
GTK_STOCK_REFRESH, GTK_RESPONSE_APPLY,
^
gdm-host-chooser-dialog.c:141:33: warning: ‘GtkStock’ is deprecated [-Wdeprecated-declarations]
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
^
gdm-host-chooser-dialog.c:142:33: warning: ‘GtkStock’ is deprecated [-Wdeprecated-declarations]
GTK_STOCK_CONNECT, GTK_RESPONSE_OK,
^
CC gdm-chooser-session.o
CC gdm-host-chooser.o
CCLD gdm-simple-chooser
CCLD gdm-host-chooser
make[3]: Leaving directory '/mnt/gdm/gui/simple-chooser'
make[3]: Entering directory '/mnt/gdm/gui'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/mnt/gdm/gui'
make[2]: Leaving directory '/mnt/gdm/gui'
Making all in utils
make[2]: Entering directory '/mnt/gdm/utils'
CC gdmflexiserver.o
CC gdm-screenshot.o
CCLD gdmflexiserver
gdm-screenshot.c: In function ‘screenshot_grab_lock’:
gdm-screenshot.c:77:9: warning: ‘gdk_pointer_grab’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkmain.h:86): Use 'gdk_device_grab' instead [-Wdeprecated-declarations]
gdk_pointer_grab (gtk_widget_get_window (selection_window), FALSE, 0, NULL,
^
gdm-screenshot.c:79:9: warning: ‘gdk_cursor_unref’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:242): Use 'g_object_unref' instead [-Wdeprecated-declarations]
gdk_cursor_unref (cursor);
^
CCLD gdm-screenshot
make[2]: Leaving directory '/mnt/gdm/utils'
Making all in po
make[2]: Entering directory '/mnt/gdm/po'
MSGFMT af.gmo
MSGFMT an.gmo
MSGFMT ar.gmo
MSGFMT am.gmo
MSGFMT as.gmo
MSGFMT ast.gmo
MSGFMT be.gmo
MSGFMT az.gmo
MSGFMT be@latin.gmo
MSGFMT bg.gmo
MSGFMT bn.gmo
MSGFMT bn_IN.gmo
MSGFMT br.gmo
MSGFMT bs.gmo
MSGFMT ca.gmo
MSGFMT ca@valencia.gmo
MSGFMT crh.gmo
MSGFMT cs.gmo
MSGFMT csb.gmo
MSGFMT cy.gmo
MSGFMT da.gmo
MSGFMT de.gmo
MSGFMT dz.gmo
MSGFMT el.gmo
MSGFMT en_CA.gmo
MSGFMT en_GB.gmo
MSGFMT en@shaw.gmo
MSGFMT eo.gmo
MSGFMT es.gmo
MSGFMT et.gmo
MSGFMT fa.gmo
MSGFMT eu.gmo
MSGFMT fi.gmo
MSGFMT fr.gmo
MSGFMT fy.gmo
MSGFMT fur.gmo
MSGFMT ga.gmo
MSGFMT gd.gmo
MSGFMT gl.gmo
MSGFMT gv.gmo
MSGFMT gu.gmo
MSGFMT he.gmo
MSGFMT hi.gmo
MSGFMT hr.gmo
MSGFMT hu.gmo
MSGFMT hy.gmo
MSGFMT id.gmo
MSGFMT is.gmo
MSGFMT it.gmo
MSGFMT ja.gmo
MSGFMT ka.gmo
MSGFMT kk.gmo
MSGFMT km.gmo
MSGFMT kn.gmo
MSGFMT ko.gmo
MSGFMT ku.gmo
MSGFMT ky.gmo
MSGFMT lt.gmo
MSGFMT lv.gmo
MSGFMT mai.gmo
MSGFMT mg.gmo
MSGFMT mi.gmo
MSGFMT mk.gmo
MSGFMT ml.gmo
MSGFMT mn.gmo
MSGFMT mr.gmo
MSGFMT ms.gmo
MSGFMT nb.gmo
MSGFMT nds.gmo
MSGFMT ne.gmo
MSGFMT nl.gmo
MSGFMT nn.gmo
MSGFMT nso.gmo
MSGFMT oc.gmo
MSGFMT or.gmo
MSGFMT pa.gmo
MSGFMT pl.gmo
MSGFMT ps.gmo
MSGFMT pt_BR.gmo
MSGFMT pt.gmo
MSGFMT ro.gmo
MSGFMT ru.gmo
MSGFMT rw.gmo
MSGFMT si.gmo
MSGFMT sk.gmo
MSGFMT sl.gmo
MSGFMT sq.gmo
MSGFMT sr.gmo
MSGFMT sr@latin.gmo
MSGFMT sv.gmo
MSGFMT ta.gmo
MSGFMT te.gmo
MSGFMT th.gmo
MSGFMT tg.gmo
MSGFMT tr.gmo
MSGFMT ug.gmo
MSGFMT uz.gmo
MSGFMT uk.gmo
MSGFMT uz@cyrillic.gmo
MSGFMT vi.gmo
MSGFMT wa.gmo
MSGFMT xh.gmo
MSGFMT zh_CN.gmo
MSGFMT zh_HK.gmo
MSGFMT zh_TW.gmo
MSGFMT zu.gmo
make[2]: Leaving directory '/mnt/gdm/po'
Making all in tests
make[2]: Entering directory '/mnt/gdm/tests'
CC m_common-s-common-address.o
CC m_common-m-common.o
m-common.c:45:9: warning: Value stored to 'failed' is never read
failed = 0;
^ ~
1 warning generated.
CCLD m-common
make[2]: Leaving directory '/mnt/gdm/tests'
Making all in docs
make[2]: Entering directory '/mnt/gdm/docs'
GEN en_GB/en_GB.mo
GEN de/de.mo
GEN ca/ca.mo
GEN el/el.mo
GEN es/es.mo
GEN fr/fr.mo
GEN gl/gl.mo
GEN hu/hu.mo
GEN id/id.mo
GEN it/it.mo
GEN ko/ko.mo
GEN oc/oc.mo
GEN pt_BR/pt_BR.mo
GEN ru/ru.mo
GEN sl/sl.mo
GEN sv/sv.mo
GEN te/te.mo
GEN uk/uk.mo
GEN zh_CN/zh_CN.mo
GEN ca/
GEN de/
GEN el/
GEN en_GB/
GEN es/
GEN fr/
GEN gl/
GEN hu/
GEN id/
GEN it/
GEN ko/
GEN oc/
GEN pt_BR/
GEN ru/
GEN sl/
GEN sv/
GEN te/
GEN uk/
GEN zh_CN/
make[2]: Leaving directory '/mnt/gdm/docs'
make[2]: Entering directory '/mnt/gdm'
make[2]: Leaving directory '/mnt/gdm'
make[1]: Leaving directory '/mnt/gdm'
scan-build: 21 bugs found.
scan-build: Run 'scan-view /mnt/gdm/sb/2015-02-14-013448-5435-1' to examine bug reports.
Version: 3.14.x