Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!cs.umn.edu!cybrspc!roy From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail) Newsgroups: comp.lang.c Subject: Re: Non-Portable pointer assignment? Message-ID: Date: 4 Jun 91 04:02:34 GMT Article-I.D.: cybrspc.Z31Z34w164w References: <1991Jun3.030641.10975@druid.uucp> Organization: Villa CyberSpace, Minneapolis, MN Lines: 41 darcy@druid.uucp (D'Arcy J.M. Cain) writes: > That's because the compiler sees you trying to assign an int to a pointer > to character. To my mind it is being too polite. It should say "Assignment > of pointer from integer lacks a cast" as well as telling you that strchr > is used without being declared. To tell the truth, I'd rather it have been a fatal compile error. That would have been more helpful to me that a warning and Doing The Right Thing. > Note that with Turbo C, like many other > ANSI compilers, will let you turn on lots of warnings and if you had done > so it would have caught this. (*) And so I shall, believe me. (that's what I get for hacking way past my bedtime :-) > BTW, TFTM (The fine Turbo manual) shows you which header file(s) you > should include if you call a function. If you include the ones it > indicates you will save yourself lots of grief one day. Agreed, as does the help function in TC IDE, and the THELP TSR. Unfortunately, I got one of those occasional recto-cranial displacements and neglected to look at them. > (*) My favorite CFLAGS with GNU C: > CFLAGS = -O -Wall -ansi -pedantic > and I still expect my programs to compile with no errors or warnings. I'll see if I can get Turbo to act similarly, although I've already had dos.h fail with the 'ANSI keywords only' directive enabled. I suppose I should just chuck DOS for an operating system. (it'd be easier to get GCC, too) Thanks for the help! -- Roy M. Silvernail -- roy%cybrspc@cs.umn.edu - OR- cybrspc!roy@cs.umn.edu perl -e '$x = 1/20; print "Just my \$$x! (adjusted for inflation)\n"' "What do you mean, you've never been to Alpha Centauri?" -- Prostetnic Vogon Jeltz