bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] lib: int8_t set to `signed char` instead of `char`


From: Ekaitz Zarraga
Subject: [PATCH] lib: int8_t set to `signed char` instead of `char`
Date: Fri, 13 Oct 2023 19:37:43 +0000

>From 4dcedfdb8e0fa1efa1c73071dcd5e866aa456e43 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz@elenq.tech>
Date: Fri, 13 Oct 2023 21:31:20 +0200
Subject: [PATCH] lib: int8_t set to `signed char` instead of `char`

`char` signedness is not defined by C standard. In some architectures
it's `unsigned` by default (RISC-V), so it's better to be explicit to
avoid problems.

* include/stdint.h(int8_t): Use `signed char` instead of `char`.
---
 include/stdint.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/stdint.h b/include/stdint.h
index 080d1029..694840dc 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -50,7 +50,7 @@
 #undef ptrdiff_t
 
 typedef unsigned char uint8_t;
-typedef char int8_t;
+typedef signed char int8_t;
 typedef unsigned short uint16_t;
 typedef short int16_t;
 typedef unsigned uint32_t;
-- 
2.41.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]