This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
build problem in tcl/compat/strstr.c
- From: Baurzhan Ismagulov <ibr at radix50 dot net>
- To: gdb at sourceware dot org
- Date: Wed, 14 Feb 2007 13:35:58 +0100
- Subject: build problem in tcl/compat/strstr.c
Hello all,
I'm building the current HEAD for --host arm-linux --target arm-linux on
an i686-linux build. tcl/compat/strstr.c references NULL, but doesn't
include anything. So the compilation fails for me.
The file gets included in the compilation since tcl/unix/configure
apparently tries to run a test, which fails since I cross-build, and
concludes that strstr is broken.
I've seen other packages recommending hard-coding stuff in cache files
for cross-compilation; I don't know whether we do this for gdb.
I don't mind having gdb's own strstr implementation compiled in, so I
did the hack below. An alternative were to check for stddef.h and
include it, otherwise defining NULL ourselves (I guess we shouldn't
include string.h since it could have a different prototype, which would
produce a warning).
How should we proceed?
With kind regards,
--
Baurzhan Ismagulov
http://www.kz-easy.com/
--- src.orig/tcl/compat/strstr.c 2003-01-21 20:39:57.000000000 +0100
+++ src/tcl/compat/strstr.c 2007-02-14 13:09:23.000000000 +0100
@@ -64,5 +64,5 @@ strstr(string, substring)
}
b = substring;
}
- return NULL;
+ return (void *)0;
}
2007-02-14 Baurzhan Ismagulov <ibr@radix50.net>
* tcl/compat/strstr.c (strstr): Return (void *)0 instead of
NULL.