Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Problems with IBM RS6000 C compiler Message-ID: <1990Aug4.213849.28666@zoo.toronto.edu> Organization: U of Toronto Zoology References: <476@mtndew.UUCP> Date: Sat, 4 Aug 90 21:38:49 GMT In article <476@mtndew.UUCP> friedl@mtndew.UUCP (Stephen J. Friedl) writes: >For instance, defines the prototype for stat: > > extern int stat(char *filename, struct stat *stptr); > >Shouldn't the "filename" argument be const qualified? I >use const all over my code, and the compiler throws up ... The filename *probably* ought to be const qualified, but the current standards are mostly written in old C and don't specify this. This is a difficult problem, although `#define const /* */' can be helpful. > extern void foo( void *** ); > any_type **array; > foo(&array); > > 9 | arrsize(&array); > .................a....... >a - 1506-193: (S) Function call arg cannot be assigned to corresponding param. >I just don't get it; the ANSI compiler on the 3B2 doen't complain about this. It should. There is a special-case exemption for implicit conversions to and from `void *'. Not `void ***'. Just `void *'. Nothing else. All other pointer types require explicit conversion. -- The 486 is to a modern CPU as a Jules | Henry Spencer at U of Toronto Zoology Verne reprint is to a modern SF novel. | henry@zoo.toronto.edu utzoo!henry