bugmake - Bugs: bug #16475, Use of potentially uninitialized...

 
 

bug #16475: Use of potentially uninitialized variables

Submitted by:  Jerker Bäck <jerker_back>
Submitted on:  Mon 01 May 2006 11:14:14 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Works for mePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: MS Windows
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 15 Sep 2013 07:28:32 PM UTC, comment #1:

This code has changed quite a bit. I don't have a Windows so I can't test this (none of these warnings appear on POSIX systems). If you still see these with the next release please add a comment and we can re-open.

Paul D. Smith <psmith>
Project Administrator
Mon 01 May 2006 11:14:14 AM UTC, original submission:

When linking with the MS linker the following warnings is issued due to possible use of variables with undefined values.

variable.c(1394) : warning C4701: potentially uninitialized local variable 'origin' used
job.c(570) : warning C4701: potentially uninitialized local variable 'status' used
job.c(677) : warning C4701: potentially uninitialized local variable 'exit_code' used
job.c(677) : warning C4701: potentially uninitialized local variable 'exit_sig' used
job.c(728) : warning C4701: potentially uninitialized local variable 'coredump' used
main.c(2225) : warning C4701: potentially uninitialized local variable 'status' used

Even if it may or may not be possible for the variables to be used uninitialized when looking at the actual code, no harm is done when initialize them to zero and get rid of the warnings.

Solution:
variable.c(1364) : const char *origin = NULL;
job.c(450) : WAIT_T status = 0;
job.c(474) : int exit_code = 0, exit_sig = 0, coredump = 0;
main.c(2143) : int status = 0;

Jerker Bäck <jerker_back>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 15 Sep 2013 07:28:32 PM UTCpsmithStatusNone=>Works for me
      Open/ClosedOpen=>Closed
      Operating SystemAny=>MS Windows

    Back to the top


    Powered by Savane 3.1-cleanup1