Commit f3ce6437 by Patrick Palka

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.

From-SVN: r231983
parent 96d4e7be
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> 2015-12-21 Nick Clifton <nickc@redhat.com>
PR 66827 PR 66827
......
...@@ -33,15 +33,14 @@ ...@@ -33,15 +33,14 @@
#include "libiberty.h" #include "libiberty.h"
/* This table was generated by the following program. This matches /* This table was generated by the following program.
what gdb does.
#include <stdio.h> #include <stdio.h>
int int
main () main ()
{ {
int i, j; unsigned int i, j;
unsigned int c; unsigned int c;
int table[256]; int table[256];
...@@ -146,10 +145,9 @@ starting value is @var{init}; this may be used to compute the CRC of ...@@ -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 data split across multiple buffers by passing the return value of each
call as the @var{init} parameter of the next. call as the @var{init} parameter of the next.
This is intended to match the CRC used by the @command{gdb} remote This is used by the @command{gdb} remote protocol for the @samp{qCRC}
protocol for the @samp{qCRC} command. In order to get the same command. In order to get the same results as gdb for a block of data,
results as gdb for a block of data, you must pass the first CRC you must pass the first CRC parameter as @code{0xffffffff}.
parameter as @code{0xffffffff}.
This CRC can be specified as: This CRC can be specified as:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment