GNOME Bugzilla – Bug 762630
Warning at compilation time
Last modified: 2016-02-25 13:22:51 UTC
Hi, I see this when compiling g-c-c: pp-jobs-dialog.c: In function ‘create_listbox_row’: pp-jobs-dialog.c:139:10: warning: ‘state_string’ may be used uninitialized in this function [-Wmaybe-uninitialized] widget = gtk_label_new (state_string); ^ pp-jobs-dialog.c:94:10: note: ‘state_string’ was declared here gchar *state_string; Marek
Created attachment 322365 [details] [review] printers: make sure the printer job state_string is initialized
(In reply to Marek Kašík from comment #0) > Hi, I see this when compiling g-c-c: > > pp-jobs-dialog.c: In function ‘create_listbox_row’: > pp-jobs-dialog.c:139:10: warning: ‘state_string’ may be used uninitialized > in this function [-Wmaybe-uninitialized] > widget = gtk_label_new (state_string); > ^ > pp-jobs-dialog.c:94:10: note: ‘state_string’ was declared here > gchar *state_string; > > Marek Thanks for spotting that. Initializing state_string to NULL is enough to have the status GtkLabel set to an empty label in the corner case where the job_state doesn't match one of the IPP_JOB_* constants.
Review of attachment 322365 [details] [review]: Thank you for the fix. Push it to the branches which need the fix please.
Attachment 322365 [details] pushed as 9dd58c0 - printers: make sure the printer job state_string is initialized