aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2024-03-14 09:05:38 -0700
committerDavid Faust <david.faust@oracle.com>2024-03-14 10:57:20 -0700
commit6cf4286ff9456685a29812a3560d00b956d62c39 (patch)
tree0c655c42db668a67aff35284f7d0f96551be63be
parentbc5a9dab55d13f888a3cdd150c8cf5c2244f35e0 (diff)
downloadgcc-6cf4286ff9456685a29812a3560d00b956d62c39.zip
gcc-6cf4286ff9456685a29812a3560d00b956d62c39.tar.gz
gcc-6cf4286ff9456685a29812a3560d00b956d62c39.tar.bz2
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.
-rw-r--r--gcc/config/bpf/bpf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h
index f107a5a..3cc5daa 100644
--- a/gcc/config/bpf/bpf.h
+++ b/gcc/config/bpf/bpf.h
@@ -99,7 +99,7 @@
#define SIG_ATOMIC_TYPE "char"
-#define INT8_TYPE "char"
+#define INT8_TYPE "signed char"
#define INT16_TYPE "short int"
#define INT32_TYPE "int"
#define INT64_TYPE "long int"