Extension of first:he "help"

Brian Glendenning brian at radio.uucp
Sat Sep 24 00:25:26 AEST 1988


In article <9600002 at silver>, mitchemt at silver writes:
>
>line 13: warning: illegal combination of pointer and integer, operation =
>line 19: redeclaration of newstrel
>line 22: warning: illegal combination of pointer and integer, op RETURN
>
>Any help getting rid of these errors would be welcome. 

It looks like you haven't declared a function, thus it defaults to integer
when you really want it to be returning a pointer. For example:

*** Shell output ***
radio<10>cat test.c

main(){ char *c_ptr;  c_ptr = myfunc(); }
char *myfunc() { return (char *)0; }

radio<11>cc test.c
"test.c", line 4: warning: illegal combination of pointer and integer, op =
"test.c", line 8: redeclaration of myfunc
"test.c", line 9: warning: illegal combination of pointer and integer, op RETURN
radio<12>cat test2.c
main() { char *c_ptr; char *myfunc(); c_ptr = myfunc(); }
char *myfunc() {  return (char *)0; }
radio<13>cc test2.c
radio<14>
*** End output ***
-- 
	  Brian Glendenning - Radio astronomy, University of Toronto
brian at radio.astro.toronto.edu uunet!utai!radio!brian  glendenn at utorphys.bitnet



More information about the Comp.lang.c mailing list