aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-28 22:00:14 +0000
committerppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-28 22:00:14 +0000
commit2afaef03604e3920fbbd1c60cb37e2cdc85599f2 (patch)
treed75501a7451aff30e3000c21a3090d0181bdc2d3 /libiberty
parentaafde35e4611f9e4543a38a9a76268b7361c6d7f (diff)
Tweak the documentation of libiberty's xcrc32 function
libiberty/ChangeLog; * crc32.c: In the documentation, don't refer to GDB's now-nonexistent crc32 implementation. In the table-generation program embedded within the documentation, change the type of the induction variables i and j from int to unsigned int, to avoid undefined behavior. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/crc32.c12
2 files changed, 13 insertions, 7 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 0bda40e0682..6073c5bfed2 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,11 @@
+2015-12-28 Patrick Palka <ppalka@gcc.gnu.org>
+
+ * crc32.c: In the documentation, don't refer to GDB's
+ now-nonexistent crc32 implementation. In the table-generation
+ program embedded within the documentation, change the type of
+ the induction variables i and j from int to unsigned int, to
+ avoid undefined behavior.
+
2015-12-21 Nick Clifton <nickc@redhat.com>
PR 66827
diff --git a/libiberty/crc32.c b/libiberty/crc32.c
index 12d9be07cfd..52c982fb583 100644
--- a/libiberty/crc32.c
+++ b/libiberty/crc32.c
@@ -33,15 +33,14 @@
#include "libiberty.h"
-/* This table was generated by the following program. This matches
- what gdb does.
+/* This table was generated by the following program.
#include <stdio.h>
int
main ()
{
- int i, j;
+ unsigned int i, j;
unsigned int c;
int table[256];
@@ -146,10 +145,9 @@ starting value is @var{init}; this may be used to compute the CRC of
data split across multiple buffers by passing the return value of each
call as the @var{init} parameter of the next.
-This is intended to match the CRC used by the @command{gdb} remote
-protocol for the @samp{qCRC} command. In order to get the same
-results as gdb for a block of data, you must pass the first CRC
-parameter as @code{0xffffffff}.
+This is used by the @command{gdb} remote protocol for the @samp{qCRC}
+command. In order to get the same results as gdb for a block of data,
+you must pass the first CRC parameter as @code{0xffffffff}.
This CRC can be specified as: