• AVR Freaks

Hot!IPv6 Flexible Array Member not at end of struct

Author
jdeguire
Super Member
  • Total Posts : 596
  • Reward points : 0
  • Joined: 2012/01/13 07:48:44
  • Location: United States
  • Status: offline
2020/07/27 11:12:21 (permalink)
5 (1)

IPv6 Flexible Array Member not at end of struct

A whole heap of Access Denied" BS means I had to put the actual contents in the attached doc. Fix your garbage forums!
#1

5 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18908
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: IPv6 Flexible Array Member not at end of struct 2020/07/27 12:37:24 (permalink)
    5 (2)
    Microchip will not be reading you Post about the Forum.
    .DOC? .TXT is safer.
    #2
    rainad
    Moderator
    • Total Posts : 1399
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: IPv6 Flexible Array Member not at end of struct 2020/07/27 12:49:28 (permalink)
    5 (2)
    Thank you for bringing this up.
    Yes, that flexible array header structure is in the middle of the IPV6_PACKET structure. 
    Obvious choice would be to move it at the end - I don't think that the code overrides that data[] member but I need to check.
    I'll create an internal issue to take care of this.
    Interestingly enough, neither xc32 nor IAR compiler didn't signal this error for our projects builds.
     
     
    #3
    jdeguire
    Super Member
    • Total Posts : 596
    • Reward points : 0
    • Joined: 2012/01/13 07:48:44
    • Location: United States
    • Status: offline
    Re: IPv6 Flexible Array Member not at end of struct 2020/07/27 13:07:41 (permalink)
    4 (1)
    NKurzman
    Microchip will not be reading you Post about the Forum.
    .DOC? .TXT is safer.

    Yeah, that's always the risk, though Microchip has responded in the past (and here too!). A plain text document would probably be better, but I did want the formatting since I was trying to post code. I thought this forum used to allow PDFs, but really the solution should be fixing the forum. It's quite ridiculous that you can't post code on a forum where'd you get help with code.
     
    rainad
    Thank you for bringing this up.
    Yes, that flexible array header structure is in the middle of the IPV6_PACKET structure. 
    Obvious choice would be to move it at the end - I don't think that the code overrides that data[] member but I need to check.
    I'll create an internal issue to take care of this.
    Interestingly enough, neither xc32 nor IAR compiler didn't signal this error for our projects builds.


    I think I posted a Compiler Explorer link in the document. If you change the "-x c++" option in the middle pane where you can select a compiler to instead say "-x c", then you'll see the error go away. It would seem that C doesn't care, but C++ does, which is probably why you haven't seen it. Also, like I stated in the doc, XC32 doesn't show a full message anyway, so it'd be easy to miss and confusing. I don't think flexible array members are actually supported by C++ but are a compiler extension, so maybe that's why. The previous version of the stack we had declared the array as having zero length, which I think suppressed the message.
     
    I can easily move the offending member to the end of the struct, but I didn't yet just because I wasn't sure if you were using some clever tricks to use the FLA to fill in the two remaining members (the TCPIP_NET_HANDLE and the IPV6_HEADER members) via a memcpy or something like that.
    #4
    jdeguire
    Super Member
    • Total Posts : 596
    • Reward points : 0
    • Joined: 2012/01/13 07:48:44
    • Location: United States
    • Status: offline
    Re: IPv6 Flexible Array Member not at end of struct 2020/07/31 12:13:08 (permalink)
    0
    On another note, I build a different configuration using the PIC32MX and I do not see the partial diagnostic even in C++ mode. The MIPS portion of XC32 is a bit older than the Arm portion (GCC 4.8.3 vs 6.2.1), so perhaps that would explain why.
    #5
    rainad
    Moderator
    • Total Posts : 1399
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: IPv6 Flexible Array Member not at end of struct 2020/08/06 10:12:12 (permalink)
    5 (3)
    The issue has been fixed and it will be part of the next net dot release (3.6.2).
    Thank you for reporting this.
     
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5