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: Craig Franck Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/08/31 Message-ID: <6scur7$qtk@bgtnsc02.worldnet.att.net>#1/1 X-Deja-AN: 386289176 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: AT&T WorldNet Services Mime-Version: 1.0 Newsgroups: comp.os.vms,comp.sys.dec,comp.lang.c 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. Is to. >1- The list of reserved words does not include function calls. Yes it does. >The compiler has no idea what "printf" is supposed to do. A compiler is allowed to know exactly how printf is supposed to function. >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. One reason standard library function names are reserved with external linkage is if you define your own function with a reserved name, the linker is not going to know whether to link with your user-defined function or the standard library function. For example, having two printfs to deal with invokes undefined- behavoir. >2- Some compilers are used to generate code for a different target >platform. [...] >There is no way that the actual compiler on DOS would know how to >translate what a "printf" might result in. A compiler would probably be more limited on what it could do, but that example doesn't prove what a compiler can or can't do overall. It is still allowed to inline code and even call specially optimized versions of printf based on how it's being used. >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. I think it's generally best to think of the standard library as part of the C language itself. The fact that it may be implementated seperately really doesn't matter; whether the preprocessor is part of the compiler or a stand alone utility really doesn't matter as long as the pakage works correctly. Also, a macro may get exapanded or a function called based on how it's being used. That is part of the language. -- Craig clfranck@worldnet.att.net Manchester, NH The most savage controversies are those about matters as to which there is no good evidence either way. -- Bertrand Russell