[bug #56817] type of pbuf->type_internal too short

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #56817] type of pbuf->type_internal too short

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/bugs/?56817>

                 Summary: type of pbuf->type_internal too short
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: klaus_br
            Submitted on: Tue 27 Aug 2019 03:16:25 PM UTC
                Category: pbufs
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.1.1

    _______________________________________________________

Details:

In file: src/include/lwip/pbuf.h:

struct pbuf->type_internal should contain
PBUF_TYPE_FLAG_* (mask: 0x00f0)
PBUF_TYPE_ALLOC_FLAG_* (mask: 0x0f00)
PBUF_TYPE_ALLOC_SRC_MASK (mask: 0x000f)

but the variable is defined as u8_t. On a TIARM compiler (and I guess also on
gcc) this results in a warning

#70-D integer conversion resulted in truncation.

The type should be u16_t instead. Otherwise it cannot be set to "PBUF_RAM" or
"PBUF_POOL"

I am using 2.1.2, which cannot be selected in the "lwIP version" field.




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56817] type of pbuf->type_internal too short

David GIRAULT-2
Follow-up Comment #1, bug #56817 (project lwip):

The information in PBUF_ALLOC_FLAG_* is not used anywhere at the moment, so it
is not stored on the pbuf.

Where does you compiler complain? There is only one assignment in
pbuf_init_alloced_pbuf() - and it has a cast: p->type_internal = (u8_t)type;


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56817] type of pbuf->type_internal too short

David GIRAULT-2
Follow-up Comment #2, bug #56817 (project lwip):

Klaus, can you upload cc.h and lwipopts.h from your project?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56817] type of pbuf->type_internal too short

David GIRAULT-2
Follow-up Comment #3, bug #56817 (project lwip):

Hello Dirk and Stian Sebastian, lwip itself compiles without warnings. I am
using a sample code of Texas Instruments with a port of MatrixSSL, which I
currently upgrade to the newest version of that stack. In this code they are
using PBUF_RAM to indicate that the payload is in one piece. It seems that in
the sample code the warning has been ignored, but it also has no negative
impact. As in my modification I need to distinguish between a pbuf coming from
the lwip stack or from MatrixSSL, I could also use a "user pbuf" with
PBUF_TYPE_ALLOC_SRC_MASK_MIN instead

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56817] type of pbuf->type_internal too short

David GIRAULT-2
Update of bug #56817 (project lwip):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel