buglwIP - A Lightweight TCP/IP stack - Bugs: bug #24921, Three potential syntax errors in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #24921: Three potential syntax errors in DHCP.c

Submitter:  Rejean Groleau <rejeangroleau>
Submitted:  Mon 24 Nov 2008 08:08:49 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Compiler Warning Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Tue 25 Nov 2008 03:26:21 PM UTC, comment #2: 

As described by Rejean, nothing needs doing here, so closing.

Jonathan Larmour <jifl>
Group Member
Tue 25 Nov 2008 12:09:09 AM UTC, comment #1: 


>Bill Auerbach wrote:
>I think that the more reasonable warning from Lint should be
>"Unnecessary address operator on array type".


So the warning is just about a nonessential operator, and this is not a bug at all.

I think the warning was thrown because decades ago "taking the address of an array name" was not consistently implemented. It is obviously no longer the case, and I must apologize for filing a bug about this. I will be more thorough next time, rest assured.

Thanks for your time,

- Rejean Groleau

Rejean Groleau <rejeangroleau>
Mon 24 Nov 2008 08:08:49 PM UTC, original submission:  

I was "linting" the LwIP source code the other day, and I found three trivial warnings that might cause problems. It is likely that the related lines of codes are in fact error-free, and that I misunderstood what they were actually doing.

1. In the file DHCP.c:
 a. Line 1472:
  - Before: options = (u8_t *)&dhcp->msg_in->file
  - After: options = (u8_t *)dhcp->msg_in->file
  - Explanation: the line was doing "pointer = address of pointer",
    instead of doing "pointer = pointer".
 b. Lines 1476 and 1481:
  - Before: options = (u8_t *)&dhcp->msg_in->sname
  - After: options = (u8_t *)dhcp->msg_in->sname
  - Explanation: (same as line 1472).

If this is indeed an error, I think it would only result in a misinterpretation of the DHCP overloaded options.

In the end, erroneous or invalid options would be used instead of the ones specified by the DHCP server.

- Rejean Groleau

Rejean Groleau <rejeangroleau>

 

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

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 jifl (Posted a comment)
  • -email is unavailable- added by rejeangroleau (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.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-11-25 jifl StatusNone Works For Me
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code