Patch to use more safe-ctype macros
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Mon Oct 22 19:55:00 GMT 2001
> From: DJ Delorie <dj@redhat.com>
>
> Please just put the original function and prototype back in. There is
> no reason to have removed it in the first place. If it were me, I
> would have not touched libiberty.h at all, and only given the array a
> useful initial value for those programs that forget to call hex_init -
> but I still would have documented that programs must call hex_init
> before using the functions. At some point in the future (EBCDIC
> variants?) it might become mandatory to call it, and it's easier to
> just document it that way all along.
>
> However, I don't mind _hex_value[] becoming a const, and having an
> empty hex_init function in libiberty/hex.c for now. But please have
> *a* function there, else the ABI for existing libiberty shared
> libraries changes in an incompatible way.
Ah.
Ok?
2001-10-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
include:
* libiberty.h (hex_init): Prototype.
libiberty:
* hex.c (hex_init): Provide empty stub.
diff -rup orig/egcs-CVS20011022/include/libiberty.h egcs-CVS20011022/include/libiberty.h
--- orig/egcs-CVS20011022/include/libiberty.h Mon Oct 22 18:29:34 2001
+++ egcs-CVS20011022/include/libiberty.h Mon Oct 22 22:38:25 2001
@@ -241,6 +241,7 @@ extern PTR xmemdup PARAMS ((const PTR, s
#define _hex_array_size 256
#define _hex_bad 99
extern const char _hex_value[_hex_array_size];
+extern void hex_init PARAMS ((void));
#define hex_p(c) (hex_value (c) != _hex_bad)
/* If you change this, note well: Some code relies on side effects in
the argument being performed exactly once. */
diff -rup orig/egcs-CVS20011022/libiberty/hex.c egcs-CVS20011022/libiberty/hex.c
--- orig/egcs-CVS20011022/libiberty/hex.c Mon Oct 22 18:29:34 2001
+++ egcs-CVS20011022/libiberty/hex.c Mon Oct 22 22:40:04 2001
@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h> /* for EOF */
#include "libiberty.h"
+/* Provided for ABI compatibility. */
+void hex_init ()
+{
+}
+
/* Are we ASCII? */
#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
&& 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \
More information about the Gcc-patches
mailing list