From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: [PATCH] Fix build error with memmem() Date: Thu, 4 Jan 2007 09:19:00 +0100 Message-ID: <200701040919.00597.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_0hLnFPqe58cEq90" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_0hLnFPqe58cEq90 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! I get this build error on *BSD with changeset 13214: symbols.c: In function `compress_symbols': symbols.c:366: warning: implicit declaration of function `memmem' symbols.c:366: warning: assignment makes pointer from integer without a cast symbols.c:385: warning: assignment makes pointer from integer without a cast gmake[3]: *** [symbols] Error 1 gmake[3]: Leaving directory `/usr/src/xen-unstable.hg/xen/tools' gmake[2]: *** [default] Error 2 gmake[2]: Leaving directory `/usr/src/xen-unstable.hg/xen/tools' gmake[1]: *** [/usr/src/xen-unstable-master.hg/xen/xen] Error 2 gmake[1]: Leaving directory `/usr/src/xen-unstable.hg/xen' The glibc manpage on Linux clearly says: CONFORMING TO This function is a GNU extension. And according to the BUGS section, this function does not work reliably. The attached patch makes this build again by replacing memmem() with strstr(). --Boundary-00=_0hLnFPqe58cEq90 Content-Type: text/x-diff; charset=us-ascii; name=xen-symbol.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen-symbol.diff diff -r 60f91c9f1a24 xen/tools/symbols.c --- a/xen/tools/symbols.c Wed Jan 03 23:53:27 2007 +0000 +++ b/xen/tools/symbols.c Thu Jan 04 09:12:52 2007 +0100 @@ -363,7 +363,7 @@ static void compress_symbols(unsigned ch p1 = table[i].sym; /* find the token on the symbol */ - p2 = memmem(p1, len, str, 2); + p2 = strstr(p1, str); if (!p2) continue; /* decrease the counts for this symbol's tokens */ @@ -382,7 +382,7 @@ static void compress_symbols(unsigned ch if (size < 2) break; /* find the token on the symbol */ - p2 = memmem(p1, size, str, 2); + p2 = strstr(p1, str); } while (p2); --Boundary-00=_0hLnFPqe58cEq90 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_0hLnFPqe58cEq90--