All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Fix build error with memmem()
Date: Thu, 4 Jan 2007 09:19:00 +0100	[thread overview]
Message-ID: <200701040919.00597.Christoph.Egger@amd.com> (raw)

[-- 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

                 reply	other threads:[~2007-01-04  8:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701040919.00597.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.