Ticket #10402: 0004-ipv6-datagram-Fix-Clang-complaining-about-a-flexible.patch

File 0004-ipv6-datagram-Fix-Clang-complaining-about-a-flexible.patch, 1.0 KB (added by js, 6 years ago)
  • src/add-ons/kernel/network/datalink_protocols/ipv6_datagram/ipv6_datagram.cpp

    From 3413272d9adaf1da8d172c3a941ea2adf847cb01 Mon Sep 17 00:00:00 2001
    From: Jonathan Schleifer <js@webkeks.org>
    Date: Sun, 12 Jan 2014 17:02:35 +0100
    Subject: [PATCH 4/6] ipv6 datagram: Fix Clang complaining about a flexible
     array member.
    
    Interestingly, [0] should be as invalid in C++ as [] in this case, yet
    Clang refuses [], but accepts [0].
    ---
     .../kernel/network/datalink_protocols/ipv6_datagram/ipv6_datagram.cpp   | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/add-ons/kernel/network/datalink_protocols/ipv6_datagram/ipv6_datagram.cpp b/src/add-ons/kernel/network/datalink_protocols/ipv6_datagram/ipv6_datagram.cpp
    index e38c433..559a1d2 100644
    a b struct router_advertisement_header {  
    9292    uint16      router_lifetime;
    9393    uint32      reachable_time;
    9494    uint32      retransmit_timer;
    95     uint8       options[];
     95    uint8       options[0];
    9696} _PACKED;
    9797
    9898