bugmake - Bugs: bug #49935, num_mkfiles uninitialized

 
 

bug #49935: num_mkfiles uninitialized

Submitter:  Martin Dorey <mdorey>
Submitted:  Mon 26 Dec 2016 06:16:55 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  4.3 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Dec 2016 02:29:04 PM UTC, comment #1: 

I neglected to try to compile with optimization... my mistake.  Fix pushed.

Paul D. Smith <psmith>
Group administrator
Mon 26 Dec 2016 06:16:55 PM UTC, original submission:  

main.c:2169:11: error: ‘num_mkfiles’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

I've been bitten by false-positives from that warning in the past, which is probably not unrelated to why it's not happening on Paul's doubtless-later compiler, but I think it has a point here:

martind@swiftboat:~/download/make-git$ git diff
diff --git a/main.c b/main.c
index df7bb3a..fa65446 100644
--- a/main.c
+++ b/main.c
@@ -2164,7 +2164,7 @@ main (int argc, char *argv, char *envp)
 
       {
         struct goaldep *d;
-        unsigned int num_mkfiles;
+        unsigned int num_mkfiles = 0;
         for (d = read_files; d != NULL; d = d->next)
           ++num_mkfiles;
 
martind@swiftboat:~/download/make-git$

Martin Dorey <mdorey>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by mdorey (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-28 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3
        Triage StatusNone Small Effort

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code