]> gcc.gnu.org Git - gcc.git/commitdiff
bpf: define INT8_TYPE as signed char
authorDavid Faust <david.faust@oracle.com>
Thu, 14 Mar 2024 16:05:38 +0000 (09:05 -0700)
committerDavid Faust <david.faust@oracle.com>
Thu, 14 Mar 2024 17:57:20 +0000 (10:57 -0700)
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.

gcc/config/bpf/bpf.h

index f107a5a4c349e0a4d6ab47314c9fc6a6ce9bdcb3..3cc5daa1b58dc4c775dd3504e25833fab0e029e9 100644 (file)
@@ -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"
This page took 0.088109 seconds and 5 git commands to generate.