Skip to content
Commit 6321aa19 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller
Browse files

phonet: fix building with clang



clang warns about overflowing the data[] member in the struct pnpipehdr:

net/phonet/pep.c:295:8: warning: array index 4 is past the end of the array (which contains 1 element) [-Warray-bounds]
                        if (hdr->data[4] == PEP_IND_READY)
                            ^         ~
include/net/phonet/pep.h:66:3: note: array 'data' declared here
                u8              data[1];

Using a flexible array member at the end of the struct avoids the
warning, but since we cannot have a flexible array member inside
of the union, each index now has to be moved back by one, which
makes it a little uglier.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarRémi Denis-Courmont <remi@remlab.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b35560e4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment