buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45019, Missing const qualifier on various...

 
 

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

bug #45019: Missing const qualifier on various struct mib_node* arrays

Submitter:  Edgar Bonet <ebonet>
Submitted:  Tue 05 May 2015 10:32:29 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Compiler Warning Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 05 May 2015 11:07:30 AM UTC, comment #1: 

Perfect, applied, thank you Edgar.

Sylvain Rochet <gradator>
Group Member
Tue 05 May 2015 10:32:29 AM UTC, original submission:  

Compiling the minimal project from the Unix port fails with the
following (slightly edited) error message:

    lwip-contrib/apps/snmp_private_mib/lwip_prvmib.c:191:1:
    error: initialization from incompatible pointer type
    (near initialization for ‘sensortable.nptr’) [-Werror]

This same error is repeated on lines 207 (near initialization for
‘example.nptr’), 221 (lwip.nptr), 235 (enterprises.nptr) and 249
(mib_private.nptr) of the same file. And again in
lwip/src/core/snmp/mib2.c, line 751, near initialization for
‘internet.nptr’.

These errors come from missing const qualifiers: in
lwip/src/include/lwip/snmp_structs.h:141, the last field of
struct mib_array_node is defined as

    const struct mib_node* const *nptr;

whereas in the incriminated files, the field is initialized with arrays
like

    static struct mib_node* const sensortable_nodes[1]

Adding the missing consts fixes these errors. This is implemented in the
attached patches:

  - 0001-Missing-const-qualifier-on-various-mib_node-arrays.patch
    for lwip-contrib (file apps/snmp_private_mib/lwip_prvmib.c)

  - 0002-Missing-const-qualifier-on-internet_nodes-in-mib2.c.patch
    for lwip (src/core/snmp/mib2.c).

PS: I could not find an appropriate category, which should be "SNMP".
This affects both lwip and contrib code.

Edgar Bonet <ebonet>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gradator (Posted a comment)
  • -email is unavailable- added by ebonet (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-05 gradator StatusNone Fixed
        Open/ClosedOpen Closed
    2015-05-05 ebonet Attached File- Added 0001-Missing-const-qualifier-on-various-mib_node-arrays.patch, #33916
        Attached File- Added 0002-Missing-const-qualifier-on-internet_nodes-in-mib2.c.patch, #33917

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code