Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!linus!decvax!watmath!dapermezel From: dapermezel@watmath.UUCP (Damon Permezel) Newsgroups: net.lang.c Subject: Portability enhancing C extension Message-ID: <5870@watmath.UUCP> Date: Fri, 30-Sep-83 17:09:51 EDT Article-I.D.: watmath.5870 Posted: Fri Sep 30 17:09:51 1983 Date-Received: Sat, 1-Oct-83 23:37:00 EDT Organization: U of Waterloo, Ontario Lines: 29 The addition of the ability to type the expected args of an external function is definitely needed in C. All you VAX-C programmers have lead a sheltered life and can't be expected to realise the need. Consider the much abused f(0); where 'f' is f(p) char *p; { ... } This works fine on the VAX, but will not work on a HW level-6, which has different sizes for each of 'int', 'int *' and 'char *'. It will also fail on the 68000, where sizeof(int) == 2 and sizeof(int *) == sizeof(char *) == 4. When we ported our compiler source from the HW DPS/8 (sizeof(most_stuff) == 4) to the level-6, we had one hell of a time (we had no lint then). If my language extension that allows extern f(char *); had been working then, most of the problems would have gone away with the inclusion of a "ext_def.h" file that defined the arg types, allowing the compiler to add the cast where necessary. I was very reluctant to add any language extensions to my parser, but this one i definitely consider worthwhile. =damon