From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,df854b5838c3e14 X-Google-Attributes: gid109fba,public X-Google-Thread: 10db24,fec75f150a0d78f5 X-Google-Attributes: gid10db24,public X-Google-Thread: 103376,df854b5838c3e14 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,df854b5838c3e14 X-Google-Attributes: gid1014db,public From: seebs@solutions.solon.com (Peter Seebach) Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada) Date: 1996/04/05 Message-ID: <4k3utg$ndp@solutions.solon.com>#1/1 X-Deja-AN: 145994560 references: <828632277snz@genesis.demon.co.uk> organization: Usenet Fact Police (Undercover) reply-to: seebs@solon.com newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu Date: 1996-04-05T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >Unix standards????? You know, POSIX, Spec 1170, X/Open, that kind of stuff. POSIX is the one the US govt. will not use Win NT because of, because it doesn't match the spec they've selected. Begging pardon, but why does an obviously well-educated person feel the need to use multiple question marks on a query about something which has been common knowledge for at least a couple of years? I've been seeing POSIX books for quite some time. It seems as though you're a bit out of touch with the Unix world; you were amazed that Linux killed a program which did read(fd, buf, nbytes); when buf wasn't large enough for nbytes, simply because the file didn't have nbytes left, and had less data than buf could hold. (This came up in a previous discussion.) You were surprised when people pointed out that standard C allows an implementation to catch and prohibit attempts to modify the internals of a FILE, and that in fact, code which does so has ceased to be legal C. You are constantly amazed by claims about standards for C or Unix which may be a year or more old. I am getting the impression that you've not really taken the time to keep up with the standards community, and have been complaining about the excessive chumminess with the compiler that used to be considered normal and healthy in C. It's not, anymore. Linus Torvalds, a man who has probably written a fair amount of low-level code in C, some of it terriyingly optimized, was recently seen flaming people for advocating unportable tricks in C - tricks which work on *every* major C implementation currently in use. I can certainly understand your position; I've seen C advocates talk about what Ada 83 did, and comparing it with C 89. But it's not fair when they do it, and it's not fair when you do it, either, no matter *how* good you are. (And I must admit, by all accounts, you're quite good.) Sometime, take a weekend or so to catch up with how modern C is written, what the standards do and don't guarantee, and look at some of the checks, warnings, and analyses available from modern C programming tools. I think you'll find that C has matured quite a lot as a programming language since, say, 1983. Most of your complaints about C and Unix match up strongly with the frustrations I had getting things to run on an SVR4/ANSI C environment in 1990 or so, when C was only a year old as a standardized language, and no one was really writing for it yet. That was quite a while ago for this industry; right now, I can write "portable" programs and expect them to work on every commercial Unix, and every free Unix. I don't have to think very hard to do it; I just write code the way I would anyway, and it magically works. I occasionally have to put in some sort of sop for a broken system, but rarely; they're getting rarer, and I don't expect to even think about it in another couple of years. -s -- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach. C/Unix wizard -- C/Unix questions? Send mail for help. No, really! FUCK the communications decency act. Goddamned government. [literally.] The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html