Path: utzoo!attcan!uunet!husc6!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.lang.c Subject: Re: lint warning messages with malloc() Message-ID: <361@marob.MASA.COM> Date: 7 Nov 88 13:21:05 GMT References: <142@cjsa.WA.COM> <355@marob.MASA.COM> <1169@microsoft.UUCP> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 24 In article <1169@microsoft.UUCP> tonyw@microsoft.UUCP (Tony Williams) writes: >In article <355@marob.MASA.COM> daveh@marob.masa.com (Dave Hammond) writes: >| You could do some fancy declaration footwork and declare >| >|X *malloc(); > >DO NOT DO THIS. Since you are using lint, I assume you care somewhat >about portability :-). There are machines out there for which >struct X * and char * have different representations. >On these machines, malloc will return the char* representation and you >must have the cast to convert it. Sorry! My example should have shown conditional inclusion for lint only, e.g.: #ifdef lint X *malloc(); #else char *malloc(); #endif Dave Hammond UUCP: ...!uunet!masa.com!{marob,dsix2}!daveh DOMAIN: daveh@marob.masa.com ----------------------------------------------------------------------------