Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!texsun!sun!imagen!kchen From: kchen@imagen.UUCP (Kok Chen) Newsgroups: comp.os.minix Subject: Problem with Minix C compiler? Message-ID: <1391@imagen.UUCP> Date: Mon, 24-Aug-87 12:30:47 EDT Article-I.D.: imagen.1391 Posted: Mon Aug 24 12:30:47 1987 Date-Received: Tue, 25-Aug-87 07:15:56 EDT Organization: Imagen Corp., Santa Clara CA Lines: 25 Has anyone else noticed a bug(?) in the C compiler in returning NULL? Example: | typedef struct { int member; /* etc */ } STRUCT ; | | STRUCT *function() | { | STRUCT *p ; | | p = (STRUCT *) NULL ; | return p ; | | return (STRUCT *) NULL ; | } The first form of return works properly, but the second form does not. (I.e., the value of the function using the second return, when compared with NULL, will result in a false condition.) No big thing, since it is easy to work around. But it can (and did) cause a lot of pain until one is aware of it :-) Kok S. Chen ..!decwrl!imagen!kchen Imagen Corporation