stat(), lstat() again.

William Roberts liam at cs.qmw.ac.uk
Fri Sep 21 05:48:04 AEST 1990


In <3434 at dftsrv.gsfc.nasa.gov> jim at jagmac2.gsfc.nasa.gov (Jim Jagielski) writes:

>In article <4062 at ursa-major.SPDCC.COM> dyer at ursa-major.spdcc.com.spdcc.COM (Steve Dyer) writes:
>>
>  Some compilers WON'T let
>  you pass structures to functions as is canon K&R.

True, but not particularly relevant. Such a compiler should
be associated with a version of lint that also insists on this, and
none of your examples did this anyway.

>  Some compilers WILL,
>  when you tell the pointer to point to NULL, have the pointer point to
>  space which is big enuff for whatever the pointer is a pointer to. This is
>  a fact.

Hang on a minute - name one such compiler!  You were the one who started
talking about "canon K&R" and XJwhatever committee numbers.

>  What the problem was was that I was looking at the code without
>  THINKING about the code... I guess someone as perfect as you has never done
>  THAT before. As far as you thinking I don't understand C, well, I beg to
>  differ. Everyone has off days with C and can't recall what they wrote or
>  what they mean, except of course yourself. I've written a bunch of C code,
>  dude and it hasn't been all 100% perfect, but no one's is, except yours,
>  of course.

Your making the EtherPort II stuff available is appreciated (I may soon
have something to add to your distribution - we have 50 of the old
EtherPort II cards so I am putting work into making they coexist with
A/UX 2.0 as well as possible).

Your flame about the mild criticisms your pointer-confusion has earned
is wildly out of proportion. You cannot both quote ANSI documents AND
say that "some compilers do ***horrid thing omitted***". 

Do you now accept that

1) the stat and lstat functions require a pointer to a statbuf structure
2) the stat and lstat functions don't do memory allocation for that structure
3) NULL is not a good choice of random address for a structure
4) You should be using &statbuf regardless of the fact that some 
   compiler/machine/architecture combinations let you get away with
   what you were doing before.

Making mistakes is forgiveable - insisting that they aren't mistakes is not.
-- 

William Roberts                 ARPA: liam at cs.qmw.ac.uk
Queen Mary & Westfield College  UUCP: liam at qmw-cs.UUCP
Mile End Road                   AppleLink: UK0087
LONDON, E1 4NS, UK              Tel:  071-975 5250 (Fax: 081-980 6533)



More information about the Comp.unix.aux mailing list