Bug#226459: gcc returns "... might be used uninitialized in this function" where it shouldn't
Package: gcc-3.2
Version: 3.2.3-9
Severity: minor
Tags: sid
Unfortunately I wasn't able to track down this issue.
The code snippet in question is from the nautilus package:
=== beginning ===
static gboolean
select_range (NautilusIconContainer *container,
NautilusIcon *icon1,
NautilusIcon *icon2)
{
gboolean selection_changed;
GList *p;
NautilusIcon *icon;
NautilusIcon *unmatched_icon;
gboolean select;
selection_changed = FALSE;
unmatched_icon = NULL;
select = FALSE;
for (p = container->details->icons; p != NULL; p = p->next) {
icon = p->data;
if (unmatched_icon == NULL) {
if (icon == icon1) {
unmatched_icon = icon2;
select = TRUE;
} else if (icon == icon2) {
unmatched_icon = icon1;
select = TRUE;
}
}
selection_changed |= icon_set_selected
(container, icon, select);
if (unmatched_icon != NULL && icon == unmatched_icon) {
select = FALSE;
}
}
=== (...) snap ===
}
=== end ===
gcc returns:
nautilus-icon-container.c: In function `handle_icon_button_press':
nautilus-icon-container.c:1768: warning: `selection_changed' might be used uninitialized in this function
obviously it actually IS always initialized
the whole file can be found under:
http://makeashorterlink.com/?S40724BF6
Do you need any additional information?
regs,
Chris
Reply to: