* [PATCH] Fix build error with memmem()
@ 2007-01-04 8:19 Christoph Egger
0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2007-01-04 8:19 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 898 bytes --]
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().
[-- Attachment #2: xen-symbol.diff --]
[-- Type: text/x-diff, Size: 623 bytes --]
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);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-04 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-04 8:19 [PATCH] Fix build error with memmem() Christoph Egger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.