public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Preudhomme <thomas.preudhomme@foss.arm.com>
To: newlib@sourceware.org
Subject: [PATCH, newlib] Make ctype_.c and ctype_.h agree on _ctype_b type
Date: Tue, 13 Sep 2016 10:53:00 -0000	[thread overview]
Message-ID: <4a262e9a-ed3c-3910-5fd6-4aa157a4bccc@foss.arm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

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

[-- Attachment #2: consistent_ctype_definition_declaration.patch --]
[-- Type: text/x-patch, Size: 1078 bytes --]

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


             reply	other threads:[~2016-09-13 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 10:53 Thomas Preudhomme [this message]
2016-09-20 17:58 ` [PATCH, newlib, ping] " Thomas Preudhomme
2016-10-03 16:11   ` [PATCH, newlib, ping2] " Thomas Preudhomme
2016-10-12  8:27     ` [PATCH, newlib, ping3] " Thomas Preudhomme
2016-10-17 14:59 ` [PATCH, newlib] " Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a262e9a-ed3c-3910-5fd6-4aa157a4bccc@foss.arm.com \
    --to=thomas.preudhomme@foss.arm.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).