From: Craig Franck <clfranck@worldnet.att.net>
Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA *
Date: 1998/08/31 [thread overview]
Message-ID: <6scur7$qtk@bgtnsc02.worldnet.att.net> (raw)
In-Reply-To: 35E9E464.AD231759@videotron.ca
JF Mezei <jfmezei.spamnot@videotron.ca> 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
next prev parent reply other threads:[~1998-08-31 4:00 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0095000017115526000002L062*@MHS>
[not found] ` <35E04DF1.1911@world.std.com>
[not found] ` <35E09E76.6773@earthlink.net>
1998-08-23 4:00 ` Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Terry C. Shannon
1998-08-23 4:00 ` Glenn C. Everhart
1998-08-24 4:00 ` Paul Sture
1998-08-25 4:00 ` Gregg E Economou
1998-08-25 4:00 ` John Wilson
1998-08-26 4:00 ` Gregg E Economou
1998-08-27 4:00 ` John Wilson
1998-08-25 4:00 ` Jordan Henderson
1998-08-26 4:00 ` Bob Koehler
[not found] ` <6s910k$2bo$1@Starbase.NeoSoft.COM>
[not found] ` <35e833be.0@news.wizvax.net>
1998-08-29 4:00 ` Jordan Henderson
1998-08-30 4:00 ` John Wilson
1998-08-30 4:00 ` JF Mezei
1998-08-30 4:00 ` Chris Torek
1998-08-31 4:00 ` Gregg E Economou
1998-08-31 4:00 ` Chris Torek
1998-08-30 4:00 ` Lawrence Kirby
1998-08-30 4:00 ` JF Mezei
1998-08-30 4:00 ` Martin Ambuhl
1998-08-31 4:00 ` Craig Franck [this message]
1998-08-30 4:00 ` JF Mezei
1998-08-31 4:00 ` firewind
1998-08-31 4:00 ` Michael Rubenstein
[not found] ` <6scur7$qtk@bgtnsc02.wo <35EA0E22.C59E9476@videotron.ca>
1998-08-31 4:00 ` Will Rose
1998-09-04 4:00 ` Thor Lancelot Simon
1998-08-30 4:00 ` Gregg E Economou
1998-08-30 4:00 ` K&R fight over ketchup (was: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA ) Clint Comes
1998-08-31 4:00 ` Bob Koehler
1998-09-05 4:00 ` Gregg E Economou
1998-09-05 4:00 ` Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Peter da Silva
1998-09-05 4:00 ` Jordan Henderson
1998-09-07 4:00 ` Peter da Silva
1998-09-07 4:00 ` Jordan Henderson
1998-09-07 4:00 ` Richard Stamp
1998-09-07 4:00 ` Dan Pop
1998-09-07 4:00 ` Peter da Silva
1998-09-07 4:00 ` Jordan Henderson
1998-09-08 4:00 ` JF Mezei
1998-09-08 4:00 ` Peter da Silva
[not found] ` <6t2im5$mke@espresso.cafe.net>
1998-09-08 4:00 ` Peter da Silva
1998-09-08 4:00 ` Peter da Silva
1998-09-08 4:00 ` Tim Shoppa
[not found] ` <6t4cui$hfu@espresso.cafe.net>
1998-09-09 4:00 ` Tim Shoppa
1998-09-08 4:00 ` JF Mezei
1998-09-09 4:00 ` Dan Pop
1998-09-09 4:00 ` Peter da Silva
1998-09-08 4:00 ` Dan Pop
1998-09-08 4:00 ` Peter da Silva
1998-09-08 4:00 ` Dan Pop
1998-08-29 4:00 ` Gregg E Economou
1998-08-30 4:00 ` Jay Maynard
1998-08-26 4:00 ` Paul Sture
1998-08-27 4:00 ` Gregg E Economou
1998-08-28 4:00 ` Paul Sture
1998-08-26 4:00 ` Bob Koehler
1998-08-27 4:00 ` Thor Lancelot Simon
1998-08-28 4:00 ` Bob Koehler
1998-09-05 4:00 ` Peter da Silva
1998-09-08 4:00 ` Carl Perkins
1998-08-28 4:00 ` TERENCE MURPHY
1998-08-28 4:00 ` George Cornelius
1998-08-28 4:00 ` Greg Thomas
1998-08-29 4:00 ` mathog
1998-09-01 4:00 ` Greg Thomas
1998-08-28 4:00 ` Monty Brandenberg
1998-08-29 4:00 ` Gregg E Economou
1998-09-05 4:00 ` Peter da Silva
1998-08-31 4:00 ` Boris
1998-08-27 4:00 ` Peter da Silva
1998-08-31 4:00 ` Boris
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox