From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,2afd440a210c7fb0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1014db,6bdc5c27a0dec527 X-Google-Attributes: gid1014db,public X-Google-Thread: 1164f8,df8a3dc583bf1f5f X-Google-Attributes: gid1164f8,public From: miker3@ix.netcom.com (Michael Rubenstein) Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/08/31 Message-ID: <35ebeca7.16000868@nntp.ix.netcom.com>#1/1 X-Deja-AN: 386279338 Content-Transfer-Encoding: 7bit References: <0095000017115526000002L062*@MHS> <6s910k$2bo$1@Starbase.NeoSoft.COM> <35e833be.0@news.wizvax.net> <6sac4v$4ti$1@Starbase.NeoSoft.COM> <35e8f9d7.0@news.wizvax.net> <904480575snz@genesis.demon.co.uk> <35E9E464.AD231759@videotron.ca> Content-Type: text/plain; charset=us-ascii Organization: ICGNetcom X-NETCOM-Date: Sun Aug 30 7:31:43 PM CDT 1998 Mime-Version: 1.0 Newsgroups: comp.os.vms,comp.sys.dec,comp.lang.c On Sun, 30 Aug 1998 19:46:52 -0400, JF Mezei wrote: >Lawrence Kirby wrote: >> The names of standard library functions are reserved as identifiers with >> external linkage. That means that it isn't valid for a user program to >> provide definitions for them. Therefore a compiler is well within its rights >> to inline calls to functions with external linkage that have the name of >> a standard library function. > >That is not true. > >1- The list of reserved words does not include function calls. The compiler >has no idea > what "printf" is supposed to do. It lets the linker figure out what to do >with that > reference. And the parameters given to the linker define where the linker >will look for > these references. This is not true. The standard function names are reserved as identifers with external linkage and, if the header declaring them is included, at file scope. From 7.1.3: - All identifiers with external linkage in any of the following subclauses [those specifying the standard library] (including the future library directions) are always reserved for use as identifiers with external linkage. - Each identifier with file scope listed in any of the following clauses (including the future library directions) is reserved for use as an identifier with file scope in the same name space if any of its associated headers is included. > >2- Some compilers are used to generate code for a different target platform. > For instance, the DOS "TopSpeed" C compiler is used to generate code for the > PSION handheld computers. Instead of linking against the DOS libraries, it > links against the PSION supplied libraries, do the reference to "printf" results > in a call to a different routine which is compatible with the PSION operating system > (which is not DOS). Both platforms are 80x86 based but run different >operating systems. > There is no way that the actual compiler on DOS would know how to translate >what a "printf" > might result in. Wyy not? It knows how to translate to the code needed to call it. Why can't it know how to translate to the code to implement it? > >3- There are some "includes" which do define macros with the same name as a >standard function > call. But that is not part of the compiler itself, it is part of the >"package" which includes > the "includes" and the library calls that are designed to integrate with >the target operating > system. An implementation MAY define macros to implement some standard functions. This is not required (there are some identifiers that are required to be macros by the standard). In any case, the functions must also be defined to allow calling them without including the header and to allow taking their address. -- Michael M Rubenstein