Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-27 10:16:53 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-30 11:47:57 +0300
commitd8d18c3e80b029449240de8b3d970c03674e9617 (patch)
treec696a9d88b7b4f82f5b0c2b820b988f253514c11 /newlib/libc
parent613a7f90361533fd5310ee836635a1e0864dfa71 (diff)
ctype: Fix integer type for caseconv_entry::delta
The commit 46ba1675c457324b0eeef4670a09101ef3f34c50 accidently changed a bit-field from signed to unsigned. The caseconv_entry::delta must be a signed integer, see also "newlib/libc/ctype/caseconv.t". Unfortunately, a standard GCC/Newlib build is done without -Wsign-conversion. Using this warning option would have helped to avoid this bug: caseconv.t:2:22: warning: unsigned conversion from 'int' to 'unsigned int:17' changes value from '-32' to '131040' [-Wsign-conversion] {0x0061, 25, TOUP, -32}, Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/ctype/towctrans_l.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/ctype/towctrans_l.c b/newlib/libc/ctype/towctrans_l.c
index 42085ac78..7b8a23c9c 100644
--- a/newlib/libc/ctype/towctrans_l.c
+++ b/newlib/libc/ctype/towctrans_l.c
@@ -39,7 +39,7 @@ static struct caseconv_entry {
uint_least32_t first: 21;
uint_least8_t diff: 8;
uint_least8_t mode: 2;
- uint_least32_t delta: 17;
+ int_least32_t delta: 17;
} __attribute__ ((packed))
caseconv_table [] = {
#include "caseconv.t"