[Pkg-electronics-devel] Bug#935818: lepton-eda: fix use of possibly-uninitialized variables, detected with -O3

Steve Langasek steve.langasek at canonical.com
Mon Aug 26 16:30:33 BST 2019


Package: lepton-eda
Version: 1.9.7-2
Severity: minor
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu eoan ubuntu-patch

Hi Bdale,

In Ubuntu, we build the ppc64el port with gcc -O3 by default.  When building
with -O3, gcc reveals a couple of minor issues with variables being possibly
used before initialization in error paths.

The attached patch fixes the uninitialized variables and allows lepton-eda
to build with -O3.  The overall package build still fails due to bug
#935281, so for now, this is not being uploaded to Ubuntu.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru lepton-eda-1.9.7/debian/patches/fix-uninitialized-variable.patch lepton-eda-1.9.7/debian/patches/fix-uninitialized-variable.patch
--- lepton-eda-1.9.7/debian/patches/fix-uninitialized-variable.patch	1969-12-31 16:00:00.000000000 -0800
+++ lepton-eda-1.9.7/debian/patches/fix-uninitialized-variable.patch	2019-08-26 07:54:52.000000000 -0700
@@ -0,0 +1,39 @@
+Description: fix use of possibly-uninitialized variables, detected with -O3
+ When building with -O3 (as on ppc64el in Ubuntu), gcc rightly notes that
+ it is possible in certain failure cases for some variables to be used
+ without having been initialized.  Initialize to zero.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Last-Update: 2019-08-26
+
+Index: lepton-eda-1.9.7/schematic/src/gschem_page_view.c
+===================================================================
+--- lepton-eda-1.9.7.orig/schematic/src/gschem_page_view.c
++++ lepton-eda-1.9.7/schematic/src/gschem_page_view.c
+@@ -597,10 +597,10 @@
+ void
+ gschem_page_view_invalidate_world_rect (GschemPageView *view, int left, int top, int right, int bottom)
+ {
+-  int screen_bottom;
+-  int screen_right;
+-  int screen_left;
+-  int screen_top;
++  int screen_bottom = 0;
++  int screen_right = 0;
++  int screen_left = 0;
++  int screen_top = 0;
+ 
+   g_return_if_fail (view != NULL);
+ 
+Index: lepton-eda-1.9.7/attrib/src/gtksheet_2_2.c
+===================================================================
+--- lepton-eda-1.9.7.orig/attrib/src/gtksheet_2_2.c
++++ lepton-eda-1.9.7/attrib/src/gtksheet_2_2.c
+@@ -8154,7 +8154,7 @@
+                                  GtkWidget *widget,
+                                  gint row, gint col)
+ {
+-  GdkRectangle area;
++  GdkRectangle area = { 0, 0, 0, 0 };
+   GtkSheetChild *child;
+ 
+   if(row < 0 || col < 0){
diff -Nru lepton-eda-1.9.7/debian/patches/series lepton-eda-1.9.7/debian/patches/series
--- lepton-eda-1.9.7/debian/patches/series	2019-01-30 09:36:25.000000000 -0800
+++ lepton-eda-1.9.7/debian/patches/series	2019-08-26 07:50:22.000000000 -0700
@@ -1,3 +1,4 @@
 desktop-entry-main-categories.diff
 definite-perl-path.diff
 guile-2.2.patch
+fix-uninitialized-variable.patch


More information about the Pkg-electronics-devel mailing list