Skip to content
Snippets Groups Projects
Commit 6cf4286f authored by David Faust's avatar David Faust
Browse files

bpf: define INT8_TYPE as signed char

Change the BPF backend to define INT8_TYPE with an explicit sign, rather
than a plain char.  This is in line with other targets and removes the
risk of int8_t being affected by the signedness of the plain char type
of the host system.

The motivation for this change is that even if `char' is defined to be
signed in BPF targets, some BPF programs use the (mal)practice of
including internal libc headers, either directly or indirectly via
kernel headers, which in turn may trigger compilation errors regarding
redefinitions of types.

gcc/

	* config/bpf/bpf.h (INT8_TYPE): Change to signed char.
parent bc5a9dab
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
#define SIG_ATOMIC_TYPE "char" #define SIG_ATOMIC_TYPE "char"
#define INT8_TYPE "char" #define INT8_TYPE "signed char"
#define INT16_TYPE "short int" #define INT16_TYPE "short int"
#define INT32_TYPE "int" #define INT32_TYPE "int"
#define INT64_TYPE "long int" #define INT64_TYPE "long int"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment