lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #45019] Missing const qualifier on various struct mib_


From: Edgar Bonet
Subject: [lwip-devel] [bug #45019] Missing const qualifier on various struct mib_node* arrays
Date: Tue, 05 May 2015 10:32:31 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0

URL:
  <http://savannah.nongnu.org/bugs/?45019>

                 Summary: Missing const qualifier on various struct mib_node*
arrays
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: ebonet
            Submitted on: mar. 05 mai 2015 10:32:29 GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: git head

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: mar. 05 mai 2015 10:32:29 GMT  Name:
0001-Missing-const-qualifier-on-various-mib_node-arrays.patch  Size: 3 ko  
By: ebonet

<http://savannah.nongnu.org/bugs/download.php?file_id=33916>
-------------------------------------------------------
Date: mar. 05 mai 2015 10:32:29 GMT  Name:
0002-Missing-const-qualifier-on-internet_nodes-in-mib2.c.patch  Size: 1013 o  
By: ebonet

<http://savannah.nongnu.org/bugs/download.php?file_id=33917>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?45019>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]