summaryrefslogtreecommitdiff
path: root/libiberty/functions.texi
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2003-05-15 19:08:25 +0000
committerJim Blandy <jimb@codesourcery.com>2003-05-15 19:08:25 +0000
commite4f79046293deef6d3ce06dde44c488309efab4a (patch)
treee80f5437354bd4298faeb38de236531d683013d2 /libiberty/functions.texi
parentcc8c88f3a72b13a50df0330e7720612931102e95 (diff)
downloadbinutils-gdb-e4f79046293deef6d3ce06dde44c488309efab4a.tar.gz
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.
Diffstat (limited to 'libiberty/functions.texi')
-rw-r--r--libiberty/functions.texi8
1 files changed, 7 insertions, 1 deletions
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 4261d864676..b34c20409e3 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -337,13 +337,19 @@ or zero if it is not. Note that the value you pass will be cast to
@end deftypefn
@c hex.c:42
-@deftypefn Extension int hex_value (int @var{c})
+@deftypefn Extension unsigned int hex_value (int @var{c})
Returns the numeric equivalent of the given character when interpreted
as a hexidecimal digit. The result is undefined if you pass an
invalid hex digit. Note that the value you pass will be cast to
@code{unsigned char} within the macro.
+The @code{hex_value} macro returns @code{unsigned int}, rather than
+signed @code{int}, to make it easier to use in parsing addresses from
+hex dump files: a signed @code{int} would be sign-extended when
+converted to a wider unsigned type --- like @code{bfd_vma}, on some
+systems.
+
@end deftypefn
@c index.c:5