Subject: Re: using uninitialized variables

From: Dominik Vogt <[email-masked]>
Date: Mon, 29 Mar 1999 06:00:42 +0200

On Sun, Mar 28, 1999 at 10:24:05PM -0500, Steve Robins wrote:
> Hi,
> 
> I did some code cleanup in a seemingly-neverending quest to make 'gcc
> -Wall' a viable option.  Right now -Wall generates too many warnings to be
> useful. 
> 
> I have the libs/ and fvwm/ directories down to only two warnings (using
> linux).  I think the final two warnings are real errors in that the
> variables in question CAN be used without initialization in some cases. 
> But the functions are too convoluted for me to follow.  If someone who
> understands this has some time, would you please look into fixing these:
> 
> ../../libs/Bindings.c: In function `ParseBinding':
> ../../libs/Bindings.c:245: warning: `keysym' might be used uninitialized in this function

This is not an error. Although keysym is passed uninitialised to another
function it is never used there since type == MOUSE_BINDING. Feel free
to initialise keysym with some value. Doesn't matter.

> ../../fvwm/builtins.c: In function `WindowShade':
> ../../fvwm/builtins.c:456: warning: `new_width' might be used uninitialized in this function

Seems to be a bug. I don't know how it's right though.

Bye

Dominiik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 29 Mar 1999 06:10:53 +0200

> Seems to be a bug. I don't know how it's right though.

After looking a bit closer I guess in line 555 new_width has to be
replaced with tmp_win->frame_width:

554  XResizeWindow(dpy, tmp_win->Parent,
555                tmp_win->frame_width - 2 * thmp_win->boundary_width,
                   ^^^^^^^^^^^^^^^^^^^^
556                max(h - 2 * tmp_win->boundary_width
557                - tmp_win->title_height, 1));

Bye

Dominik ^_^

---

From: Tim Phipps <[email-masked]>
Date: Mon, 29 Mar 1999 10:44:23 +0100

> replaced with tmp_win->frame_width:

This is me again, I'll fix it soon. Think I should spend more time
gardening.

Cheers,
Tim.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 29 Mar 1999 13:03:35 +0200

> This is me again, I'll fix it soon. Think I should spend more time

We should all. After the tremendous amount of work we did in the last
half year we should ask Jason to shut down the servers for a month
and slow down for a while.

Bye

Dominik ^_^

          ^
          |___ That's dedicated to my poor kitten Luthien that was
               run over by a car two and a half weeks ago :(( She
               never saw a summer.
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]