Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: comp.lang.c Subject: Re: Questions on X3J11 draft Message-ID: <3508@sdcrdcf.UUCP> Date: Mon, 8-Dec-86 18:04:05 EST Article-I.D.: sdcrdcf.3508 Posted: Mon Dec 8 18:04:05 1986 Date-Received: Tue, 9-Dec-86 02:58:13 EST References: <351@danews.ATT.COM> <7373@utzoo.UUCP> <3800@watmath.UUCP> <775@axis.UUCP> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation R&D, Santa Monica Lines: 26 Keywords: C,X3J11 In article <775@axis.UUCP> philip@axis.UUCP (Philip Peake) writes: >In article <3800@watmath.UUCP> rbutterworth@watmath.UUCP writes: >>I can think of a perfectly conforming ANSI compiler that will break >>almost any existing C code. Imagine a piece of code such as the following: >> #include >> { >> extern int getchar(); >> auto int c; >> c=getchar(); >>At the moment, this will blow up on (all?) existing C compilers since >>"getchar" is a macro. Of course everyone KNOWS this and so never puts >>such things into their code. But under ANSI, almost any function can >>be defined as a macro in the header files. That means that almost >>any program that contains an "extern type libCfunc();" in it can >>potentially break under a conforming ANSI compiler. >How can I know, when trying to write portable code, if the 'library' >function I am going to use is a real function or a macro ? Easy, you say (using the above example): #ifndef getchar extern int getchar(); #endif Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb