Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!alberta!ers!teletron!andrew From: andrew@teletron.UUCP (Andrew Scott) Newsgroups: comp.lang.c Subject: lint question Message-ID: <99@teletron.UUCP> Date: Tue, 15-Sep-87 15:45:28 EDT Article-I.D.: teletron.99 Posted: Tue Sep 15 15:45:28 1987 Date-Received: Sun, 20-Sep-87 03:00:22 EDT Organization: TeleTronic Communications Ltd., Edmonton, Alta. Lines: 37 Keywords: lint function pointer cast I've noticed something odd while working with pointers to functions. Specifically, I have a chunk of code which is simulating a function call. The code pushes a return address onto the "stack" (declared as an integer array) like so: void foo() { /* do some stuff */ } void push() { extern int *stack_ptr; *(--stack_ptr) = (int) foo; } Lint returns the following messages: (10) operands of CAST have incompatible types (10) operands of = have incompatible types However, lint is happy if I declare `foo' as: int foo() { /* do some stuff */ } In either case, the compiler says nothing and produces the intended code result. Is my version of lint broken? I would have thought that a cast from a function pointer to an integer would be the same thing for any function, no matter what type value it returns (including void). Andrew