aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>2003-05-15 19:02:13 +0000
committerJim Blandy <jimb@redhat.com>2003-05-15 19:02:13 +0000
commitd35825c2b0f104fccedf4d967da2ea691950fda4 (patch)
treed12d899096b8ea3aba0270edec52389c46f4100e /include
parent13620f9ae235d0903129253d5cb2b7cb56580d99 (diff)
libiberty/ChangeLog:
2003-05-14 Jim Blandy <jimb@redhat.com> * hex.c (_hex_value): Make this unsigned. (hex_value): Update documentation for new return type. hex_value now expands to an unsigned int expression, to avoid unexpected sign extension when we store it in a bfd_vma, which is larger than int on some platforms. * functions.texi: Regenerated. include/ChangeLog: 2003-05-14 Jim Blandy <jimb@redhat.com> * libiberty.h (hex_value): Make the value an unsigned int, to avoid unexpected sign-extension when cast to unsigned types larger than int --- like bfd_vma, on some platforms. (_hex_value): Update declaration. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@66840 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/libiberty.h4
2 files changed, 9 insertions, 2 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index e4aad2ba993..c7c271b1ca9 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-15 Jim Blandy <jimb@redhat.com>
+
+ * libiberty.h (hex_value): Make the value an unsigned int, to
+ avoid unexpected sign-extension when cast to unsigned types larger
+ than int --- like bfd_vma, on some platforms.
+ (_hex_value): Update declaration.
+
2003-05-07 Jason Merrill <jason@redhat.com>
* hashtab.h (iterative_hash): Prototype.
diff --git a/include/libiberty.h b/include/libiberty.h
index 676ceaba4a9..761b2cf060f 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -254,12 +254,12 @@ extern double physmem_available PARAMS ((void));
#define _hex_array_size 256
#define _hex_bad 99
-extern const char _hex_value[_hex_array_size];
+extern const unsigned 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. */
-#define hex_value(c) (_hex_value[(unsigned char) (c)])
+#define hex_value(c) ((unsigned int) _hex_value[(unsigned char) (c)])
/* Definitions used by the pexecute routine. */