Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news2 From: Michael Wojcik Newsgroups: comp.lang.java.programmer Subject: Re: =?UTF-8?B?QW5kcm9pZOKAlFdoeSBEYWx2aWs/?= Date: Tue, 07 Jun 2011 11:42:16 -0400 Organization: Micro Focus Lines: 101 Message-ID: References: NNTP-Posting-Host: pe30e7285de4375bfca9ccc6190dc22ec622c90101c47d9ca.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5090 BGB wrote: > On 6/3/2011 2:06 PM, Michael Wojcik wrote: >> BGB wrote: >>> On 6/3/2011 6:40 AM, Michael Wojcik wrote: >>>> BGB wrote: >>>>> >>>>> yeah... sadly, the C ABI is a little bit prone to variations >>>> >>>> There is no "C ABI". If you believe otherwise, please cite the >>>> appropriate language from ISO/IEC 9899. I'll accept any version. >> => >>> more like "there is no universal standardized C ABI...", and nothing is >>> stated in the C standards to this effect, but, there ARE C-ABIs... >> >> Wrong. Those are platform ABIs. They have nothing to do with C, a >> language defined by ISO/IEC 9899, and not by implementations thereof >> or their dependencies. >> > > they are used for C, and defined in relation to C, and if one uses a > different ABI, their code doesn't work on the given platform... My keyboard is used for C, and it contains characters used by the C language. That doesn't make it a C keyboard. > so, same-difference really... That sort of sloppy thinking is precisely why so much C code is lousy. > it is thus mandatory supplementary material. Wrong. There's nothing that prevents a C implementation from targeting an environment other than the host platform. The first C compiler for the AS/400 targeted the EPM (Extended Program Model) environment, which was not the main platform ABI. In fact, OS/400 at the time didn't have a single ABI; it had at least three, and the main one for application programs was the OPM (Original Program Model). C programs that wanted to invoke OPM routines had to use the QPXXCALL API. Later C implementations for OS/400 targeted other ABIs: System/C for OPM and ILE C for ILE. A C implementation doesn't need to target a platform ABI at all. The Standard permits a C implementation to target a virtual machine, which might be completely self-contained. An implementation can target the bare metal, and indeed such implementations are common for embedded computers. In fact, a C implementation isn't strictly required to produce an executable program. >> Microsoft's cdecl calling convention for Windows has nothing to do >> with C, despite the name. > > cdecl is also used on Linux on x86, and several other OS's (AFAIK > FreeBSD and others), and so is not specific to MS. It's still Microsoft's cdecl calling convention. They invented and named the thing. That other people have adopted it does not change that. > MS's own convention, "stdcall", is used far less often... Microsoft defines more calling conventions than __cdecl and __stdcall: __fastcall, __thiscall, __clrcall; and the now-obsolete __pascal, __fortran, and __syscall. >>> in its common form: >> >> Details are irrelevant. And feel free to devote similar efforts to >> your grandmother's egg-sucking edification; I've been dealing with the >> inner details of various ABIs for a quarter-century. > > I also write compilers... Hurrah for you. Who hasn't? > the details *are* the thing in question. No, they are not. The question is whether the ABI is part of C, and it is not. > a computer is itself details, as are programming languages, and there is > nothing apart from its details. Now I can't tell whether you're being tiresome or sophomoric. > the pure C standard, by itself, would be effectively useless for getting > much done. It's useful for defining the C programming language. > much of its utility is due to all of this other stuff, which FWIW, is > treated as if it were a part of the language, as it exists on the > platforms in question. Yes, by sloppy thinkers. -- Michael Wojcik Micro Focus Rhetoric & Writing, Michigan State University