Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!hao!noao!hsi!stevens From: stevens@hsi.UUCP Newsgroups: net.lang.c Subject: type cast in initializer Message-ID: <302@hsi.UUCP> Date: Wed, 29-Jan-86 08:15:57 EST Article-I.D.: hsi.302 Posted: Wed Jan 29 08:15:57 1986 Date-Received: Sat, 1-Feb-86 05:48:10 EST Distribution: net Organization: Health Systems Int., New Haven, CT. Lines: 26 I've found the two lines int x = 0; char *ptr = (char *) &x; acceptable to every C compiler I've used, until running into the Whitesmith's C compiler. They refuse to accept the type coercion "(char *)" on the second initialization. As I read K&R this should be acceptable through the rules initializer: = expression (Sec. 8.6) expression: ( type-name ) expression (Sec. 7.2) I talked to Whitesmiths about this and they are firm that their interpretation of the "standard" is that a type coercion following the equals sign is not allowed and they don't plan to change their compiler. Am I missing something ?? What does the proposed ANSI standard have to say about this ?? Richard Stevens Health Systems International, New Haven, CT ihnp4 ! hsi ! stevens