From: peter@ferranti.com (peter da silva)
Subject: Re: 386BSD's non-standard C library
Organization: Xenix Support, FICC
Date: Sat, 3 Oct 1992 20:44:40 GMT

In article <rcskb.718045970@minyos.xx.rmit.OZ.AU> rcskb@minyos.xx.rmit.oz.au (Kendall Bennett) writes:
> Oh? That is my problem? I assume that since this is a new standard (first
> proposed back in what - 1983?), and it is not supported on all systems
> I should not use it, but write my code in pre-historic K&R C with lotsa
> #defines since non K&R system is ever comapatable with another?

Well, I've only recently got to use ANSI compilers, and I don't see any great
advance in portability. The SAS and Aztec compilers on the same platform
require just as many #ifdefs as ever to write code that will run under
both.

In addition, the standard *is* a lot newer than 1983. It wasn't finalised
until a couple of years ago. I don't see that writing code you expect to
have ported to K&R specs (especially since in this case the K&R code will
execute correctly on an ANSI compiler without ifdefs) is that much of a
hardship.

> Well I hate to inform you, but this is the totally wrong approach. I 
> write all of my C code so that it is ANSI conforming, and any UNIX
> stuff I write I try to make it POSIX conforming. Now if it so happens
> that my code does not run on your system because your compiler and
> runtime library and ancient - well you will simply have to update you
> compiler and runtime library.

That's not possible, since there are no commercial or free ANSI compilers
that will run on the 40 or so Xenix-286 systems I support.

> Take a look at the code for the GNU standard C library. It is written
> to work under K&R C compilers, and I pity having to write code like this.

Writing a library is a lot harder, since you have to become aware of lots
of stuff that normal code can ignore. Like whether read() can be expected
to return reasonable values on error: portable code doesn't call read.

> I'll leave this type of 'portable' coding up to you - me, I'll stick to
> the standards and wait for the vendors to get with it.

Must be nice to not have to deal with the real world.

> >Anyone with pretentions of writing portable code should be forced to port
> >their code to (say) Xenix-286.

> Ha ha. Why not make people who write UNIX apps port their code to run
> under MSDOS?

Because that won't teach you good design practices. You have to bvreak the
rules to get decent performance out of DOS. I've been there.

Working on Xenix-286 will prepare you for 64-bit compilers.

> >Fix your code. Run lint over it until it lints clean.

> This is something I have never been able to do.

I see.

> Sometimes I really wonder when the UNIX world will catch up with
> the technology that is currently available on DOS based systems for
> program development.

I wonder when the DOS world will catch up to UNIX, for system development.

> Believe me, integrated development environments
> are incredibly usedful when you are trying to _teach_ people about
> programming,

Yes, they are. They're also a pain for large projects. Of course you don't
DO large projects under DOS.

Of course I wouldn't dream of teaching people about programming with C
anyway. It's like putting them on a trapese without a net on the first
day. I'd start with Lisp, Pascal (UCSD or something like it, not Turbo),
all the old standbys.
-- 
Peter da Silva                                          `-_-'
Ferranti Intl. Ctls. Corp.                               'U` 
Sugar Land, TX  77487-5012           "Heeft u vandaag al uw wolf geknuffeld?"
+1 713 274 5180      "If you want PL/I, you know where to find it." -- Dennis