memcmp warning fix

Nick Burrett nick at dsvr.net
Mon Jun 10 11:04:35 PDT 2002


Peter Naulls wrote:
> This fixes a type warning in memcmp:
> 
> Index: memcmp.c
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/memcmp.c,v
> retrieving revision 1.2.2.1
> diff -u -r1.2.2.1 memcmp.c
> --- memcmp.c	3 Apr 2002 07:45:46 -0000	1.2.2.1
> +++ memcmp.c	10 Jun 2002 17:49:37 -0000
> @@ -15,10 +15,10 @@
>  #include <string.h>
>  
>  int
> -memcmp (const void *s1, const void *s2, size_t n)
> +memcmp (register const void *s1, register const void *s2, size_t n)
>  {
> -  const unsigned char *_s1 = s1;
> -  const unsigned char *_s2 = s2;
> +  register const unsigned char *_s1 = s1;
> +  register const unsigned char *_s2 = s2;
>  
>    while (n & 0x07)
>      {
> 

I don't understand why adding `register' here would make any difference.

Confused,



-- 
Nick Burrett
Development Manager, Designer Servers Ltd.   http://www.dsvr.co.uk




More information about the gcc mailing list