Date: Mon, 25 Oct 2004 16:16:47 +0100 From: Richard Williamson <richard.williamson@u4eatech.com> To: freebsd-questions@freebsd.org Subject: odd warning message from gcc under FreeBSD 4.10 Message-ID: <417D18DF.1040607@u4eatech.com>
next in thread | raw e-mail | index | archive | help
Hello,
Is this something known about, or: What am I missing?
TIA,
rip
PROBLEM:
man strstr says: returns char *
test code throws warning on line 7:
test.c:7: warning: assignment makes pointer from integer \
without a cast
TEST CODE
int main (int argc, void ** argv)
{
char *pBlah = 0x0;
char rudolph[64] = "Rudolph the Red Nosed Reindeer";
char red[4] = "Red";
pBlah = strstr(rudolph, red);
printf("1: %s\n", rudolph);
printf("2: %s\n", red);
printf("3: %s\n", pBlah);
}
TEST COMPILE (linux)
bash-2.05b# gcc -o test test.c
bash-2.05b# uname -a
Linux mir 2.6.8-gentoo-r7 #1 Mon Oct 11 14:18:22 BST 2004 \
i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
bash-2.05b# ./test
1: Rudolph the Red Nosed Reindeer
2: Red
3: Red Nosed Reindeer
bash-2.05b#
TEST COMPILE (FreeBSD)
venus 17:11 [~/cassess2] rip>gcc -o test test.c
test.c: In function `main':
test.c:7: warning: assignment makes pointer from integer \
without a cast
venus 17:11 [~/cassess2] rip>uname -a
FreeBSD venus.degree2.com 4.10-RELEASE FreeBSD 4.10-RELEASE #0: \
Tue May 25 22:47:12 GMT 2004
root@perseus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
venus 17:12 [~/cassess2] rip>./test
1: Rudolph the Red Nosed Reindeer
2: Red
3: Red Nosed Reindeer
venus 17:12 [~/cassess2] rip>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?417D18DF.1040607>
