GNOME Bugzilla – Bug 334114
Use of uninitialised variable reported by the Coverity checker
Last modified: 2009-09-15 08:46:45 UTC
431 static gboolean 432 recalc_bounds (PlannerUsageRow *row) 433 { 434 PlannerUsageRowPriv *priv; 435 GnomeCanvasItem *item; 436 gint width; Event var_decl: Declared variable "x_debut_real" without initializer Also see events: [uninit_use] 437 gdouble x_debut, x_fin, x_debut_real; 438 gdouble old_x, old_x_start, old_width; 439 gboolean changed; 440 441 item = GNOME_CANVAS_ITEM (row); 442 443 priv = row->priv; 444 445 old_x = priv->x; 446 old_x_start = priv->x_start; 447 old_width = priv->width; 448 449 usage_row_ensure_layout (row); 450 At conditional (1): "(priv)->layout != 0" taking true path 451 if (priv->layout != NULL) { 452 pango_layout_get_pixel_size (priv->layout, 453 &width, 454 NULL); 455 } 456 else { 457 width = 0; 458 } 459 At conditional (2): "width > 0" taking true path 460 if (width > 0) { 461 width += TEXT_PADDING; 462 } 463 464 priv->text_width = width; 465 At conditional (3): "(priv)->assignment != 0" taking false path 466 if (priv->assignment) { 467 get_assignment_bounds (priv->assignment, priv->scale, 468 &x_debut, &x_fin, &x_debut_real); 469 } At conditional (4): "(priv)->resource != 0" taking false path 470 else if (priv->resource) { 471 get_resource_bounds (priv->resource, priv->scale, &x_debut, 472 &x_fin, &x_debut_real); 473 } 474 475 priv->x = x_debut; 476 priv->width = x_fin - x_debut; Event uninit_use: Using uninitialized value "x_debut_real" Also see events: [var_decl] 477 priv->x_start = x_debut_real
It reports the same thing for: gdouble x_debut; and gdouble x_fin; in the same function.
Created attachment 69081 [details] [review] First attempt at fixing this. Same patch for 334113, 334114, 334116 , 334117, 334121
Looks like this patch was applied. Closing.