Bug 2542

Summary: dead assignment on wifi mac-low
Product: ns-3 Reporter: natale.patriciello
Component: wifiAssignee: sebastien.deronne
Status: RESOLVED FIXED    
Severity: enhancement CC: ns-bugs
Priority: P5    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: patch

Description natale.patriciello 2016-11-06 06:04:45 UTC
Created attachment 2660 [details]
patch

Very simple case, but please check if the variable (that now is read inside the NS_LOG_DEBUG statement) should be used somewhere else. Without the log statement, the variable value is ignored.
Comment 1 sebastien.deronne 2016-11-06 06:11:00 UTC
Natale, this will provide the same output right? But I guess this is better as you propose.
Comment 2 sebastien.deronne 2016-11-06 06:11:46 UTC
But I am a bit confused by the title of this bug though ...
Comment 3 natale.patriciello 2016-11-06 06:30:43 UTC
In fact a dead assignment triggered the error on the static analyzer, but I have corrected it by using that value, rather than removing the useless assignment.

Just before the log statement, the variable currentSequenceNumber has been assigned the value peek'd from the header, but then in the log statement is peek'd again the value from the header.

currentSequenceNumber, later in the code, is overwritten with another value; this lead to the dead assignment error. The patch uses the variable in the log statement instead of peeking again the value.

Note that I'm not sure if the value currentSequenceNumber should be used somewhere else, or it was assigned just for logging purpose.
Comment 4 sebastien.deronne 2016-11-07 16:44:07 UTC
OK to push
Comment 5 sebastien.deronne 2016-11-07 17:12:19 UTC
changeset 12394:b41f53199fc5