Bug 121260 - 3 * local variable read from before written to + 1* uninit const
3 * local variable read from before written to + 1* uninit const
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gnumeric (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Caolan McNamara
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-19 16:03 EDT by d.binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-30 16:14:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2004-04-19 16:03:25 EDT
Description of problem:

I just tried to compile Core2 Test2 package gnumeric-1.2.6-3.1

The compiler said

1.

format.c(1402): remark #592: variable "newformat" is used before its
value is set

The source code is

        sf = style_format_new_XL (newformat->str, FALSE);

But

[root@localhost SPECS]# grep newformat
../BUILD/gnumeric-1.2.6/src/format.c
        GString *newformat;
        sf = style_format_new_XL (newformat->str, FALSE);
        g_string_free (newformat, TRUE);
[root@localhost SPECS]#

We can clearly see that the compiler is correct. Suggest code re-work.

2.

sheet-object-widget.c(1556): remark #592: variable "err" is used
before its value is set

        gboolean err;
        int result;

        v = gnm_expr_eval (dep->expression, eval_pos_init_dep (&pos, dep),
                           GNM_EXPR_EVAL_SCALAR_NON_EMPTY);
        result = value_get_as_int (v);
        value_release (v);
        if (!err) {

We can clearly see that the compiler is correct. Suggest code re-work.

3.


sheet-object-widget.c(1691): remark #592: variable "err" is used
before its value is set
sheet-object-widget.c(1788): remark #592: variable "err" is used
before its value is set
sheet-object-widget.c(1814): remark #592: variable "err" is used
before its value is set

Duplicates.

4.

ms-obj.c(260): warning #413: variable "attr" has an uninitialized
const field

The source code is

                MSObjAttr attr;

There is no way to initialise this field in C code. Try using C++
instead ?


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Caolan McNamara 2004-04-30 15:21:35 EDT
caolanm->d.binderman: I guess these are warnings from the kcc compiler ?
Comment 2 d.binderman 2004-04-30 15:43:59 EDT
>I guess these are warnings from the kcc compiler ?

No, the Intel C compiler.

I was unaware that the Kai kcc is available for Linux/x86.


Comment 3 Caolan McNamara 2004-04-30 16:14:22 EDT
Yeah, icc is what I meant.

On point 1: Actually this code is in a code path which is not possible
to execute, as there is a switch beforehand on which all conditions
return.

On points 2 & 3. It is correct that some "errs" are not set, and that
they are used in "if (err)", but they are all empty, i.e. they are "if
(err) {}" 

On point 4: only the attr.id field is set, but only the attr.id field
is used, so there is no problem there.

Nevertheless I wrapped up a patch to fix these warnings and submitted
it upstream to gnumeric. i.e.
http://bugzilla.gnome.org/show_bug.cgi?id=141525
As its just some compilation warnings which after analysis don't
impact on the actual installed gnumeric I don't believe further action
is required.

Note You need to log in before you can comment on or make changes to this bug.