2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00
ovs/include/sparse/rte_memcpy.h
David Marchand fc3d5e1dad sparse: Fix build with DPDK and GCC 12.
rte_vect.h pulls some AVX512 instrinsics headers added in GCC 12 [1]
trigger a lot of warnings:

libtool: compile:  env "REAL_CC=ccache gcc" "CHECK=sparse -Wsparse-error
	-I ../include/sparse -I ../include -m64 -I /usr/local/include
	" cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1
	-D__MMX_WITH_SSE__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1
	-D__SSE__=1 -D__SSE2__=1 -DHAVE_CONFIG_H -I. -I.. -I ../include
	-I ./include -I ../lib -I ./lib -Wstrict-prototypes -Wall
	-Wextra -Wno-sign-compare -Wpointer-arith -Wformat
	-Wformat-security -Wswitch-enum -Wunused-parameter
	-Wbad-function-cast -Wcast-align -Wstrict-prototypes
	-Wold-style-definition -Wmissing-prototypes
	-Wmissing-field-initializers -fno-strict-aliasing
	-Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
	-Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow
	-Wmultistatement-macros -Wcast-align=strict -mssse3
	-I/home/dmarchan/git/pub/dpdk.org/22.11/install/include
	-include rte_config.h -I/usr/local/include -Werror
	-D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/bfd.lo -MD -MP
	-MF lib/.deps/bfd.Tpo -c ../lib/bfd.c -o lib/bfd.o
../lib/bfd.c: note: in included file (through
	/usr/lib/gcc/x86_64-redhat-linux/12//include/immintrin.h,
	/usr/lib/gcc/x86_64-redhat-linux/12//include/x86intrin.h, ...):
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:9:
	error: '_Float16' has implicit type
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
	error: Expected ; at end of declaration
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
	error: got __v8hf
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
	error: Expected ; at end of statement
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
	error: got {
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
	error: Expected ) in expression
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
	error: Expected ) in function call
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
	error: Expected ) in function call
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2328:50:
	error: Expected ) in function call
[...]

Besides, the list of headers by rte_memcpy.h is now out of sync with DPDK.
OVS takes care to include the right headers in its sources.
Simply make this header self-sufficient.

1: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a68412117fa4

Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-02-10 20:09:29 +01:00

37 lines
1.3 KiB
C

/* Copyright (c) 2017 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RTE_MEMCPY_H
#define RTE_MEMCPY_H 1
#ifndef __CHECKER__
#error "Use this header only with sparse. It is not a correct implementation."
#endif
#include <stddef.h>
#include <stdint.h>
/* Declare the same functions as the real rte_memcpy.h, without defining them.
* This gives sparse the information it needs without provoking sparse's
* complaints about the implementations. */
void rte_mov16(uint8_t *, const uint8_t *);
void rte_mov32(uint8_t *, const uint8_t *);
void rte_mov64(uint8_t *, const uint8_t *);
void rte_mov128(uint8_t *, const uint8_t *);
void rte_mov256(uint8_t *, const uint8_t *);
void *rte_memcpy(void *, const void *, size_t);
#endif /* RTE_MEMCPY_H_WRAPPER */