comp.lang.ada
 help / color / mirror / Atom feed
From: "William J. Leary Jr." <Bill_Leary@msn.com>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Date: 1997/12/20
Date: 1997-12-20T00:00:00+00:00	[thread overview]
Message-ID: <#vJ8k2aD9GA.169@upnetnews03> (raw)
In-Reply-To: 67hg7m$g9f$1@sparcserver.lrz-muenchen.de



>Kurt Watzka wrote in message <67hg7m$g9f$1@sparcserver.lrz-muenchen.de>...
>>"William J. Leary Jr." <Bill_Leary@msn.com> writes:
>>> Kaz Kylheku wrote in message <67gvpa$m3t$1@brie.direct.ca>...
--- ((..omitted..))
>What Kaz Kylheku is missing is the word "hosted environement".

Yes, very good.  THAT makes a lot of sense, and I've seen that myself.
Still, that's the environment, not the langauge specification for C.

--- ((..omitted..))
>>Not usually.  Their "special status" comes from the fact that they get put
>>into the symbol table because you always include "stdio.h" or "stdlib.h"
or
>>whatever.
>
> Not so. The names are reserved in a hosted environment no matter what
> headers are included.

Again, I agree.  The environment might well require that.  The language
spec. doesn't.

> This is what Kaz was trying to tell you.

Not me.  he was writing to someone else.

> "All identifiers with external linkage in any of the following (i.e
> the library) subclauses including the future library directions
> are always reserved for use as identifiers with external linkage"
> cannot be interpreted in a way that restricts the reservation to
> compilation units that include certain standard headers.

Yep, no disagreement.  But we seem to be getting rather far afield of the
argument I was commenting on, which *appeared* to be that the C language
_itself_ included the standard library.

>> In some cases a compiler will pay special attention to some of
>>the routines (like strcpy) so it can inline them
>>automagically.
>
>I doubt that it is allowed to do so in a freestanding environenment
>without explicitly stating that fact in its documentation.


Yes. The one I used (Metaware) and reviewed (Orin? Ordin? I'm not sure...
years ago) both had notes in their compiler switches section about these
features.  Metaware also included it in the debugging section, since it was
impossible to set a breakpoint on, say, strcpy if it was inlined.

>> In all cases where I've seen this there's been a compiler
>> switch to turn it off.
>
>Again, the point is the difference between a freestanding environement
>and a hosted environment.

I absolutely agree with you.  However, the thread of conversation I reviewed
didn't seem to be talking about operation under an environment.  It seemed
to be a discussion about the basic C language and it's supposed inclusion of
the standard library as part of that language.

> In a freestanding environment, the name and type of the function called at
program
> startup are implementation defined. It may well be "void
ToasterStart(float
> TimerSetting)". There are otherwise no reserved external identifiers in a
freestanding
> environment. This means that you are indeed free to use names in your
toaster control
> program  that would be reserved identifiers in a program targeting a
hosted
> environment.

Agreed again.

>> I've dumped the standard library lots of times and written new routines
for
>> some of the standard features and never had a compiler or linker complain
>> about them.
>
>>> If any C program contains an external definition of an identifier that
is
>>> an external name reserved by the standard library, the behavior is
undefined.
>
> This means that neither the compiler nor the linker is obliged in any
> way to complain about the redefinition of functions from the standard
> library, but the behaviour of such a program is still undefined. "It
> worked so far" is a _very_ weak proof of correctness, given that
> undefined behaviour may well be limited to Thursdays before Friday
> the 13th in odd years.

No disagreement here either.


>> If you link in the standard library, you usually get a linker error,
unless
>> the linker isn't too bright.  If you don't link in the library, it
usually
>> just works as expected.  That is, your routine which replaced, say,
fputc,
>> just gets linked in.
>
>This need not be true in a hosted environment. The compiler may well
>inline calls to fputc(), or generate calls to __libc_term_FPUTC instead.


It might well inline the function, but inlining is a performance issue.
It's not supposed to break the integrity of the program in doing so.  On the
other hand, I don't disagree with you or him here.  If the compiler writer
has chosen to make such things primative AND doesn't pass on the symbols for
the inlined to the linker, so they can be caught if re-used incorrectly,
then of course it's undefined.

>>> Secondly, if you include a standard header, you may not redeclare any
>>> symbol in that standard header, not even in a nested scope.
>
>>Done it several times.  Program started in DOS, so I needed the standard
>>libs for progress messages.  Switched to protected mode in high memory and
>>zapped DOS in low RAM for buffers.  Used my own fputc and so forth after
>>that.
>
>You wouldn't mind telling us which companies use or sell your products,
>would you?

The Bytex Series 7700 Token Ring / Ethernet Programmable Hub.

Long before the product got to market we'd eliminated the DOS stage and
booted directly into protected mode from a modified BIOS, but the initial
system did indeed work this way.

The other I'm not at liberty to discuss due to non-disclosure agreements.

>>> I'm not talking about optimization. I'm talking about recognition of
standard
>>> functions as thought they where primitives. The C standard permits an
>>> implementation to do that.
>
>> Yep, some compilers will do that.  Metaware, for example, will catch
memcpy
>> and optimize it for the 80x86 REPT modifier.  It can be turned off with a
>> compile time switch, because it's NOT part of the C langauge but rather
is
>> the compiler maker noticing a chance to get you better executing code by
>> implementing one of the standard library functions as if it were a
language
>> primitave.
>
> The possibility that the definition of the C programming language indeed
> does permit what Kaz claims it to permit does obviously escape you.

Not at all.  I've read the ANSI C spec and it clearly leave a lot of leeway
about how things are implemented.  I agreed.

> An implementation of the C programming language is free to recognize calls
> to functions from the standard C library as special cases and treat them
in a
> special way.

Yep.  I agreed with that.  No argument at all.  In fact, I provided an
example of an compiler I'd used which did just that.

> If you think that this is not so, don't try to prove your point with
statements like "I tried
> it once and it looked as if it worked on the implementation I was using at
that time".

I didn't.  I pointed out how one specific implementation (Metaware) had both
done the optimization route AND complied with the language spec by providing
a switch to turn off the inlines.

> Try to find some text in the language definition that supports your point
of view.


Supports it how?

My point of view is that the C _language_ does not include the C
_standard_library_ functions as part of the _language_.  A particular C
programming environment may well do something other than this, and that's
their option.

I don't see what it is I'm supposed to use to support my point of view,
unless you'd like me to quote the entire language and end up saying "no
standard library primitives found herein."

For that matter, whether you'd like me to do that or not, perhaps you can
point me to a place on the net where the ANSI C spec is available.  I've
just done a search and I've found the ANSI C++ spec, but can't find the ANSI
C spec.  The one I had belonged to my former employer and I had to leave it
there when I left the company.

    - Bill







  reply	other threads:[~1997-12-20  0:00 UTC|newest]

Thread overview: 245+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199712121931.LAA25389@sirius.infonex.com>
1997-12-12  0:00 ` Which language pays most 17457 -- C++ vs. Java? Roedy Green
1997-12-17  0:00   ` Wes Groleau
1997-12-16  0:00     ` steve
1997-12-18  0:00       ` Alicia Carla Longstreet
1997-12-17  0:00         ` steve
1997-12-19  0:00           ` Larry Elmore
1997-12-19  0:00             ` James Giles
1997-12-18  0:00         ` John Seitz
1997-12-18  0:00           ` Robert Robbins
1997-12-19  0:00             ` Mark Wilden
1997-12-19  0:00           ` Ian Upright
1997-12-19  0:00             ` William Murray
1997-12-19  0:00               ` steve
1997-12-20  0:00               ` Robert Munck
     [not found]         ` <01bd0c0b$53cc1860$26db45cf@juddesk>
1997-12-17  0:00           ` steve
1997-12-18  0:00           ` Peter Seebach
1997-12-17  0:00             ` steve
1997-12-19  0:00               ` Kaz Kylheku
1997-12-17  0:00                 ` steve
1997-12-22  0:00               ` Lawrence Kirby
1997-12-21  0:00                 ` steve
1997-12-28  0:00                   ` Lawrence Kirby
1997-12-18  0:00             ` James Giles
1997-12-17  0:00               ` steve
1997-12-19  0:00                 ` James Giles
1997-12-18  0:00                   ` steve
1997-12-19  0:00                     ` James Giles
1997-12-18  0:00                       ` steve
1997-12-19  0:00                         ` James Giles
1997-12-22  0:00                       ` Lawrence Kirby
1997-12-21  0:00                         ` James Giles
1997-12-21  0:00                           ` steve
1997-12-30  0:00                             ` Chris Gray
1997-12-28  0:00                           ` Lawrence Kirby
1997-12-28  0:00                             ` John Winters
1997-12-30  0:00                             ` paulr
1997-12-31  0:00                               ` Which language pays most " arnie sherman
1997-12-30  0:00                                 ` Dann Corbit
1997-12-31  0:00                                 ` John Slaman
     [not found]                                   ` <01bd198f$4050d960$68c8b5cc@dhite.unicomp.net>
1998-01-06  0:00                                     ` Jedi
1998-01-10  0:00                                     ` Highlander Consulting
1998-01-11  0:00                                       ` Patricia Shanahan
1998-01-11  0:00                                         ` Barrabazz
1998-01-11  0:00                                           ` Patricia Shanahan
1998-01-12  0:00                                           ` Ron Peterson
1998-01-14  0:00                                             ` anonymous
1998-01-19  0:00                                               ` Joe Gwinn
     [not found]                                                 ` <01bd2526$66b70fa0$d6d945cf@juddesk>
1998-01-23  0:00                                                   ` dnns
1998-01-23  0:00                                                     ` Philosophers Nick Roberts
1998-01-23  0:00                                                       ` Spam--> was:Re: Philosophers Dann Corbit
1998-01-24  0:00                                                         ` Nick Roberts
1998-01-26  0:00                                                           ` Doug Miller
1998-01-24  0:00                                                       ` Philosophers John G.
     [not found]                                                         ` <Pine.LNX.3.95. <34cd2808.10685219@newsroom.tassie.net.au>
1998-01-28  0:00                                                           ` Philosophers docdwarf
     [not found]                                                             ` <01bd2c40$b62837a0$7261b693@HP5079Q>
1998-01-28  0:00                                                               ` Philosophers The Goobers
1998-02-01  0:00                                                                 ` Philosophers Scott Adams
     [not found]                                                                 ` <01bd2cc0$f0042b70$7261b693@HP5079Q>
1998-02-04  0:00                                                                   ` Philosophers The Goobers
1998-02-10  0:00                                                                 ` Back to the topic of CS students. (was Re: Philosophers) cyanide
1998-02-10  0:00                                                                   ` Nick Roberts
1998-01-30  0:00                                                             ` Philosophers jim
1998-01-30  0:00                                                               ` Philosophers Samuel Mize
1998-01-30  0:00                                                               ` Philosophers docdwarf
1998-01-30  0:00                                                                 ` Philosophers suzie
1998-01-30  0:00                                                                   ` Philosophers docdwarf
1998-01-31  0:00                                                                 ` Philosophers Martin Richardson
1998-01-31  0:00                                                                   ` Philosophers Jeff York
1998-02-01  0:00                                                                     ` Philosophers Martin Richardson
1998-02-02  0:00                                                                       ` Philosophers Jeff York
1998-02-02  0:00                                                                       ` Philosophers Eddie Armstrong
1998-02-03  0:00                                                                         ` Philosophers Nyk Tarr
1998-02-02  0:00                                                                       ` Philosophers Pat O'Connell
1998-02-02  0:00                                                                     ` Philosophers Robert Garskof
1998-02-02  0:00                                                                       ` Philosophers Dave Tholen
1998-02-10  0:00                                                             ` Philosophers cyanide
1998-02-09  0:00                                                               ` Philosophers The Goobers
1998-02-18  0:00                                                             ` Philosophers Mad Hamish
1999-07-29  0:00                                                         ` Philosophers firewind
1998-01-24  0:00                                                           ` Philosophers John G.
1998-02-10  0:00                                                             ` Drifting further off topic cyanide
1998-01-25  0:00                                                           ` Philosophers Jens Schweikhardt
1998-01-28  0:00                                                           ` Philosophers Mad Hamish
1998-01-27  0:00                                                             ` Philosophers Kurt Wall
1998-01-24  0:00                                                       ` Philosophers Mike Whiten
1998-01-24  0:00                                                         ` Philosophers The Goobers
1998-01-25  0:00                                                           ` Philosophers Arnold Trembley
1998-01-25  0:00                                                             ` Philosophers The Goobers
1998-01-26  0:00                                                           ` :-) Philosophers Giovanni Drogo [drogo@rn.bastiani.it]
1998-01-29  0:00                                                           ` Philosophers Steve Dekorte
1998-01-29  0:00                                                             ` Philosophers The Goobers
1998-01-27  0:00                                                     ` Which language pays most -- C++ vs. Java? Robert Garskof
1998-01-28  0:00                                                 ` Steve Dekorte
1998-01-28  0:00                                                   ` Barrabazz
1998-01-28  0:00                                                     ` dogmat
1998-01-29  0:00                                                       ` Tim Oxler
1998-01-29  0:00                                                       ` Tim Oxler
1998-01-29  0:00                                                       ` Joe Gwinn
1998-01-29  0:00                                                         ` coryb
1998-01-29  0:00                                                         ` Wayne L. Beavers
1998-01-29  0:00                                                           ` Frank A. Adrian
1998-02-03  0:00                                                           ` GLE
1998-02-03  0:00                                                             ` The Goobers
1998-02-03  0:00                                                             ` Harold Stevens ** PLEASE SEE SIG **
1998-01-30  0:00                                                         ` Robert S. White
1998-01-30  0:00                                                           ` Patricia Shanahan
1998-01-31  0:00                                                           ` Paul Van Bellinghen
1998-02-01  0:00                                                             ` Nick Roberts
1998-02-09  0:00                                                         ` cyanide
1998-02-10  0:00                                                           ` Bill Lynch
1998-02-10  0:00                                                             ` Jeff Knaggs
1998-02-10  0:00                                                             ` Michael Rot13 Klein
1998-02-10  0:00                                                           ` dogmat
1998-02-09  0:00                                                       ` cyanide
1998-02-10  0:00                                                         ` dogmat
1999-07-29  0:00                                                       ` Edwin Purvee
     [not found]                                                     ` <01bd2c3c$6726d520$8101b8c7@MIS-RKW95.spartan.com>
1998-02-10  0:00                                                       ` Steve Dekorte
1998-02-10  0:00                                                         ` Bill Lynch
1998-02-11  0:00                                                         ` dogmat
1998-01-29  0:00                                                   ` Joe Gwinn
1998-01-31  0:00                                                 ` Larry Wiggins
1999-07-29  0:00                                                   ` Ben Pfaff
1999-07-29  0:00                                                     ` Kaz Kylheku
     [not found]                                                 ` <6alu5l$onm$1@owl.slip <01bd2c3c$6726d520$8101b8c7@MIS-RKW95.spartan.com>
1998-02-02  0:00                                                   ` Kaz Kylheku
1998-02-02  0:00                                                     ` Michael C. Kasten
1998-02-02  0:00                                                 ` This thread has drifted miles from its subject line Wes Groleau
     [not found]                                                 ` <6alu5l$ <34D6243C.2A53@gc057.fw.hac.com>
1998-02-05  0:00                                                   ` Paul Osborn
     [not found]                                                 ` <6alu5l$onm$1@owl.slip <34E0D798.E29D6CA0@cableol.co.uk>
1998-02-11  0:00                                                   ` Which language pays most -- C++ vs. Java? Kaz Kylheku
     [not found]                                               ` <gwinn-1901981219520001@dh5055142. <01bd284c$4b0b4fe0$c0f682c1@xhv46.dial.pipex.com>
1998-01-24  0:00                                                 ` Philosophers Kaz Kylheku
     [not found]                                               ` <gwinn-1901981219520001@dh5055142. <34CE059C.634DE881@snet.com>
1998-01-27  0:00                                                 ` Which language pays most -- C++ vs. Java? Kaz Kylheku
1998-01-28  0:00                                                   ` Robert Garskof
     [not found]                                               ` <gwinn-1901981219520001@dh5055142. <34C9F3D0.6B5A@erols.com>
1998-01-28  0:00                                                 ` Philosophers Warren B. Focke
1998-01-29  0:00                                                   ` Philosophers The Goobers
1998-02-05  0:00                                                     ` Philosophers Warren B. Focke
1998-02-05  0:00                                                       ` Philosophers The Goobers
1998-02-06  0:00                                                         ` Philosophers dogmat
1998-02-06  0:00                                                           ` Philosophers docdwarf
1998-02-06  0:00                                                             ` Philosophers dogmat
1998-02-06  0:00                                                               ` Philosophers docdwarf
1998-02-06  0:00                                                       ` Philosophers Harold Stevens ** PLEASE SEE SIG **
1998-02-10  0:00                                                         ` Film "Contact" Nick Roberts
1998-02-09  0:00                                             ` Which language pays most -- C++ vs. Java? cyanide
1998-01-11  0:00                                       ` Kaz Kylheku
1998-01-11  0:00                                         ` Carsten Arnholm
1998-01-15  0:00                                         ` Highlander Consulting
1998-01-16  0:00                                         ` Charles F Hankel
1999-08-09  0:00                                         ` Paul Groves
1999-08-09  0:00                                           ` Kaz Kylheku
1998-01-02  0:00                                 ` Philip Hunt
1997-12-31  0:00                             ` Which language pays most 17457 " Guillermo Schwarz
1997-12-31  0:00                               ` Billy Chambless
1998-01-03  0:00                                 ` Berna L Massingill
1998-01-04  0:00                               ` Lawrence Kirby
1997-12-19  0:00                   ` Peter Seebach
1997-12-19  0:00                     ` James Giles
1997-12-18  0:00                       ` steve
1997-12-23  0:00                       ` Guillermo Schwarz
1997-12-19  0:00         ` Chip Ling
1997-12-17  0:00     ` James Giles
     [not found] ` <349793cb.33600861@news.wxs.nl>
     [not found]   ` <34923264.75B5@netup.cl>
     [not found]     ` <670qio$8a$1@sparcserver.lrz-muenchen.de>
     [not found]       ` <3494B7DA.5463@ici.net>
     [not found]         ` <34958D16.190C@gsg.eds.com>
     [not found]           ` <679807$8gm@ws1.emirates.net.ae>
     [not found]             ` <e9k976.8h3.ln@localhost>
1997-12-18  0:00               ` Klaus-Georg Adams
     [not found]               ` <67bjnv$j35$1@brie.direct.ca>
     [not found]                 ` <349B0417.D4DB6A30@its.cl>
1997-12-20  0:00                   ` Kaz Kylheku
1997-12-20  0:00                     ` William J. Leary Jr.
1997-12-20  0:00                       ` Kurt Watzka
1997-12-20  0:00                         ` William J. Leary Jr. [this message]
1997-12-21  0:00                           ` Peter Seebach
1997-12-21  0:00                       ` Peter Seebach
1997-12-21  0:00                         ` William J. Leary Jr.
1997-12-22  0:00                           ` Peter Seebach
1997-12-22  0:00                         ` Lawrence Kirby
1997-12-22  0:00                           ` Kaz Kylheku
1997-12-22  0:00                           ` Kurt Watzka
1997-12-28  0:00                             ` Lawrence Kirby
1997-12-24  0:00                           ` John Porter
1997-12-24  0:00                             ` Kaz Kylheku
1997-12-27  0:00                               ` Which language pays most? Smalltalk, not C++ nor Java Guillermo Schwarz
1997-12-27  0:00                                 ` Patricia Shanahan
1997-12-27  0:00                                 ` Joshua Waxman
1997-12-27  0:00                                 ` Robert Dewar
1997-12-29  0:00                                   ` John Porter
1997-12-29  0:00                                     ` Lawrence Kirby
     [not found]                                     ` <01bd147e$11496760$6a28b4cf@carla.ici.net>
1997-12-29  0:00                                       ` Billy Chambless
1997-12-30  0:00                                       ` Jeffrey Templon
1997-12-30  0:00                                         ` Patricia Shanahan
1997-12-30  0:00                                           ` Charles R Martin
1998-01-03  0:00                                       ` Lawrence Kirby
1997-12-29  0:00                                     ` Patricia Shanahan
1997-12-29  0:00                                     ` Kaz Kylheku
1997-12-29  0:00                                     ` Robert Dewar
     [not found]                                       ` <01bd14b4$dc6f6a80$6428b4cf@carla.ici.net>
1997-12-29  0:00                                         ` Robert Dewar
1997-12-30  0:00                                           ` Billy Chambless
1997-12-31  0:00                                         ` David Thornley
1997-12-31  0:00                                           ` Keith G. Murphy
1998-01-01  0:00                                           ` Robert Dewar
1998-01-01  0:00                                             ` Patricia Shanahan
1998-01-02  0:00                                               ` Robert Dewar
1998-01-02  0:00                                                 ` Peter Seebach
1998-01-02  0:00                                                   ` Robert Dewar
1998-01-02  0:00                                                   ` firewind
1998-01-02  0:00                                                     ` Ian Piumarta
1998-01-03  0:00                                                     ` Richard Kenner
1998-01-02  0:00                                           ` Shelly Mujtaba
1998-01-02  0:00                                             ` Guillermo Schwarz
1998-01-03  0:00                                               ` Jacqueline U. Robertson
1998-01-03  0:00                                               ` Dean Roddey
1998-01-03  0:00                                                 ` Jacqueline U. Robertson
1998-01-03  0:00                                                   ` Dean Roddey
1998-01-05  0:00                                                     ` Guillermo Schwarz
1998-01-05  0:00                                                       ` Kaz Kylheku
1998-01-03  0:00                                         ` Lawrence Kirby
1998-01-28  0:00                                     ` SmallTalk Execute files Thaminda Erangane Perera
1998-01-28  0:00                                       ` Dann Corbit
1998-01-29  0:00                                         ` Griff Lewis
1997-12-28  0:00                                 ` Which language pays most? Smalltalk, not C++ nor Java Kurt Watzka
1997-12-29  0:00                                   ` Kaz Kylheku
1997-12-29  0:00                                   ` Guillermo Schwarz
1997-12-29  0:00                                     ` Kaz Kylheku
1997-12-30  0:00                                     ` Kaz Kylheku
1997-12-30  0:00                                     ` Billy Chambless
1997-12-30  0:00                                     ` Lawrence Kirby
1997-12-30  0:00                                       ` Patricia Shanahan
1998-01-03  0:00                                         ` Lawrence Kirby
1998-01-03  0:00                                           ` Patricia Shanahan
1997-12-30  0:00                                     ` Joshua Waxman
1997-12-30  0:00                                       ` Kaz Kylheku
1997-12-30  0:00                                         ` Joshua Waxman
1997-12-30  0:00                                         ` Robert Dewar
1997-12-30  0:00                                           ` Dann Corbit
1997-12-31  0:00                                             ` John Porter
1997-12-31  0:00                                               ` Jon S Anthony
1998-01-02  0:00                                                 ` Robert Dewar
1997-12-31  0:00                                             ` David Thornley
1997-12-31  0:00                                               ` Robert Dewar
1997-12-30  0:00                                       ` firewind
1997-12-30  0:00                                         ` Joshua Waxman
1997-12-31  0:00                                           ` Robert Dewar
1997-12-31  0:00                                         ` Brock
1997-12-31  0:00                                           ` Dann Corbit
1997-12-31  0:00                                           ` Joshua Waxman
1998-01-01  0:00                                           ` firewind
1997-12-30  0:00                                       ` Robert Dewar
1997-12-30  0:00                                         ` Kaz Kylheku
1997-12-29  0:00                                 ` Kaz Kylheku
1998-01-02  0:00                                 ` Tor Iver Wilhelmsen
1997-12-25  0:00                             ` Which language pays most 17457 -- C++ vs. Java? Kurt Watzka
1997-12-19  0:00 ` Quowong P Liu
1997-12-19  0:00   ` William J. Leary Jr.
1997-12-24  0:00   ` Richard D Riehle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox