From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/06 Message-ID: <619nmn$4jv$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 278128987 Distribution: ] References: <612k6f$i79@news-rocq.inria.fr> Organization: Comp Sci, RMIT University, Melbourne, Australia. NNTP-Posting-User: ok Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec harley@pauillac.inria.fr (Robert Harley) writes: >Richard A. O'Keefe (ok@goanna.cs.rmit.edu.au) wrote: >>Doesn't work. >> >>There's an illuminating discussion in the rationale of the POSIX.1 >>standard [...] >> >>THIS is Nick Maclaren's point. Given >> char **triMat; >>the declaration >> double const * const * const constTriMat = triMat; >>is simply illegal. >Sure, and it's "simply illegal" to assume that integer arithmetic is >done in binary. This is completely wrong, and betrays a total lack of familiarity with the history or content of the C standard. The C standard *requires* binary integer arithmetic. C89 was carefully worded to allow any of sign-and-magnitude (like Unisys A series machines) ones complement (like Unisys 2200 machines) twos complement But the C standard is quite clear that all integer arithmetic results must be as if one of these systems were in use. In contrast, the mismatched pointer example is one where the compiler is not merely not required to make it work, the compiler is *REQUIRED* to issue a diagnostic. >But guess what, there are other implementations that are not only >plausible but actually exist! So? The C standardisers were not interested in limiting C to only the machines where your prejudices happen to be valid. The C9X revisers have no interest in such limitations either. >And they have implementation-dependent >features left open by the standard, and extensions not specified by >the standard! Gasp! Yeah, but mixing up pointers to differently qualified objects is NOT only of those things left open. >Over here in the real world, we compile our programs with them: >compilers for which integers are in binary which the C standard clearly and explicitly requires >and type qualifiers >give warnings sometimes, not errors. Then you are not using standard C compilers. That is your privilege. >If you are allergic to such a >warning, stick in a cast as Nick suggested. No. The diagnostics are required because a cast _wouldn't_ fix the problem. >>>Whereas your beloved Fortran checks that the user's assumptions about >>>lack of aliasing are correct, perhaps? >> >>Yes, there are indeed static checkers available for Fortran that will >>check such assumptions. I have not used any myself, but I am aware of >>two. >Ah, so in the case of C refer to the standard only, in order to >criticize limitations in it. Are you serious? I have not criticised any limitation in the C standard at all. I have pointed out that the kind of Stupid Pointer Tricks (comp.std.c idiom) you want to play are explicitly forbidden by the standard. I THINK THIS IS RIGHT. I am not criticising the standard there, I am approving it. >But for other languages, dredge up extra >features you "are aware of" in implementations you've never used. Those checkers enforce aspects of the Fortran standard. C compilers are required to enforce aspects of the C standard. As for me, I use the best static checkers for C that I can get my hands on, and if I did as much Fortran coding as I do C, I would make sure to use the best static checkers for Fortran that I could get my hands on. >Everybody is fooled by this devastating ploy, so we'll now delete our >programs, apps and O.S.es, the transport protocols that will send this >message and so on, and rewrite them in a superior language. Oh grow up. Where did I say C was inferior? On *one specific point*, I provided factual support for Nick Maclaren's claim. That has absolutely no bearing on whether one language is better than the other *in general* or for any particular *nominated purpose*. C was not designed for high performance numeric computing, so it is no disgrace that it isn't _quite_ as well suited to that task as Fortran, which _was_ designed for high performance numeric computing. Fortran was not designed for implementing operating systems, so it is no disgrace that it (F95) isn't _quite_ as well suited to that task as C, which _was_ designed for implementing operating systems. C is good enough to stand on its own merits without people telling lies about it. -- John �neas Byron O'Keefe; 1921/02/04-1997/09/27; TLG,TLTA,BBTNOTL. Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.