Ethereal-dev: Re: [Ethereal-dev] memcmp and memcpy warnings

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 28 Jun 2001 12:18:15 -0700 (PDT)
> I get the following warnings when I compile the latest
> nightly tarball (28th)
> 
> reassemble.c: In function `fragment_equal':
> reassemble.c:61: warning: implicit declaration of function `memcmp'
> reassemble.c: In function `fragment_add':
> reassemble.c:226: warning: implicit declaration of function `memcpy'
> Making register.c

	...

> Of course things work ok, but it seems strange. Is there a
> prototype or header file missing or .. ?

If "implicit declaration of function 'XXX'" appears, with "XXX" being
the name of a system-API function, it's a header file that's missing -
<string.h>, in this case.

I don't know why that hasn't showed up on other platforms; perhaps
<string.h> happened to be included by some header file that was included
by "reassemble.c" ("included by" here being the transitive closure of
the "is-#included-by" relation; yes, given that, I could have left out
"included by some header file that was included by") on most platforms,
but the latest glibc changed that.

In any case, I've checked in a change to have "reassemble.c" directly
include <string.h>.