misc: clang-11 and gcc-10 support 78/29378/3
authorDamjan Marion <damarion@cisco.com>
Sat, 10 Oct 2020 17:17:58 +0000 (19:17 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 12 Oct 2020 16:41:49 +0000 (16:41 +0000)
clang-11 complains:

 error: field 'buffer_template' with variable sized type 'vlib_buffer_t' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]

Type: improvement
Change-Id: I2cb6b4fde723a05b42cf33dd8130df074f0362ab
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/CMakeLists.txt
src/plugins/dpdk/device/dpdk.h
src/plugins/memif/private.h
src/vnet/devices/virtio/device.c
src/vnet/pg/pg.h

index 499a39f..0d971fd 100644 (file)
@@ -13,7 +13,7 @@
 
 cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
 
-set(CMAKE_C_COMPILER_NAMES clang-10 clang-9 gcc-9 cc)
+set(CMAKE_C_COMPILER_NAMES clang-11 clang-10 clang-9 gcc-10 gcc-9 cc)
 
 project(vpp C)
 
index 40f9dce..94842a5 100644 (file)
@@ -356,9 +356,9 @@ typedef struct
   u16 device_index;
   u8 queue_index;
   struct rte_mbuf mb;
+  u8 data[256];                        /* First 256 data bytes, used for hexdump */
   /* Copy of VLIB buffer; packet data stored in pre_data. */
   vlib_buffer_t buffer;
-  u8 data[256];                        /* First 256 data bytes, used for hexdump */
 } dpdk_tx_trace_t;
 
 typedef struct
@@ -367,8 +367,8 @@ typedef struct
   u16 device_index;
   u16 queue_index;
   struct rte_mbuf mb;
-  vlib_buffer_t buffer;                /* Copy of VLIB buffer; pkt data stored in pre_data. */
   u8 data[256];                        /* First 256 data bytes, used for hexdump */
+  vlib_buffer_t buffer;                /* Copy of VLIB buffer; pkt data stored in pre_data. */
 } dpdk_rx_trace_t;
 
 void dpdk_device_setup (dpdk_device_t * xd);
index 4613512..187888d 100644 (file)
@@ -225,9 +225,9 @@ typedef struct
   memif_copy_op_t *copy_ops;
   u32 *buffers;
 
+  memif_desc_t desc_template;
   /* buffer template */
   vlib_buffer_t buffer_template;
-  memif_desc_t desc_template;
 } memif_per_thread_data_t;
 
 typedef struct
index 32c1eab..5c4412f 100644 (file)
@@ -74,8 +74,8 @@ typedef struct
 {
   u32 buffer_index;
   u32 sw_if_index;
-  vlib_buffer_t buffer;
   generic_header_offset_t gho;
+  vlib_buffer_t buffer;
 } virtio_tx_trace_t;
 
 static u8 *
index f5b5e5a..da2c2b5 100644 (file)
@@ -402,8 +402,8 @@ clib_error_t *pg_capture (pg_capture_args_t * a);
 
 typedef struct
 {
-  vlib_buffer_t buffer;
   u32 buffer_index;
+  vlib_buffer_t buffer;
 }
 pg_output_trace_t;