This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, newlib] Make ctype_.c and ctype_.h agree on _ctype_b type


Hi,

_ctype_b is defined in ctype_.c as a const char array for non cygwin targets allowing negative ctype index but as a char array for the same targets in ctype_.h, giving type conflict at compile time. This is because the cygwin targets are not treated specially in the latter file.
This patch adds the necessary logic for cygwin targets in ctype_.h.

Is this ok for master branch?

Best regards,

Thomas
>From d0d7c27c247aeec7bbfe80378961b653b08b9d2b Mon Sep 17 00:00:00 2001
From: Thomas Preud'homme <thomas.preudhomme@arm.com>
Date: Tue, 6 Sep 2016 11:26:55 +0100
Subject: [PATCH] Make ctype_.c and ctype_.h agree on _ctype_b type

_ctype_b is defined in ctype_.c as a const char array for non cygwin
targets allowing negative ctype index but as a char array for the same
targets in ctype_.h, giving type conflict at compile time.  This is
because the cygwin targets are not treated specially in the latter file.
This patch adds the necessary logic for cygwin targets in ctype_.h.
---
 newlib/libc/ctype/ctype_.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/newlib/libc/ctype/ctype_.h b/newlib/libc/ctype/ctype_.h
index 10a4b42..5356d38 100644
--- a/newlib/libc/ctype/ctype_.h
+++ b/newlib/libc/ctype/ctype_.h
@@ -6,7 +6,11 @@
 
 #ifdef ALLOW_NEGATIVE_CTYPE_INDEX
 
+#ifndef __CYGWIN__
+  extern _CONST char _ctype_b[];
+#else
   extern char _ctype_b[];
+#endif
 # define DEFAULT_CTYPE_PTR	((char *) _ctype_b + 127)
 
 #else	/* !ALLOW_NEGATIVE_CTYPE_INDEX */
-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]