Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!rutgers!clyde!ima!haddock!karl From: karl@haddock.UUCP (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Linting Malloc (Was: Re: Need help with pointer to array[][]) Message-ID: <389@haddock.UUCP> Date: Tue, 17-Mar-87 12:31:11 EST Article-I.D.: haddock.389 Posted: Tue Mar 17 12:31:11 1987 Date-Received: Thu, 19-Mar-87 03:13:41 EST References: <132@batcomputer.tn.cornell.edu> <1911@utah-gr.UUCP> <5347@mimsy.UUCP> <1661@trwrb.UUCP> <15040@sun.uucp> Reply-To: karl@haddock.ISC.COM.UUCP (Karl Heuer) Organization: Interactive Systems, Boston Lines: 19 Summary: void * is not aligned -- warning is appropriate In article <15040@sun.uucp> guy@sun.UUCP (Guy Harris) writes: [In response to a query about silencing the lint warning on malloc] >No [solution], short of waiting for ANSI C, where there is a "void *" data >type for "generic" pointers, and "malloc" returns a pointer of that type. >Presumably pointers of this type could be converted to and from pointers of >other types, in implementations that support "void *", without this "lint" >warning. (Yes, there is still a possible alignment problem, but "lint" >should assume that somebody writing a routine that constructs a "void *" >value and returns it knows this already and has dealt with it.) I would prefer that lint *not* make this assumption, and continue to give the warning; however, there should be a new lint-pragma /*ALIGNED*/ to handle the malloc-like functions. (This need not wait for ANSI C. Somebody should write this and post it to mod.sources.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint (Relevant section of X3J11, as of the May86 Draft: (5.5) Common Warnings: An implicit narrowing conversion is encountered, such as the assignment of a pointer to void to [some other pointer].