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

Submitted by:  Edgar Bonet <ebonet>
Submitted on:  Tue 05 May 2015 10:32:29 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Compiler WarningStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned 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>
Project 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>

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gradator (Posted a comment)
  • -unavailable- added by ebonet (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 05 May 2015 11:07:30 AM UTCgradatorStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 05 May 2015 10:32:29 AM UTCebonetAttached 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.1-cleanup1