Date: Fri, 18 Aug 95 20:35 MDT From: mat AT ardi DOT com (Mat Hostetter) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: BUG IN V2?? Newsgroups: comp.os.msdos.djgpp References: <410ib1$qtl AT mark DOT ucdavis DOT edu> >>>>> "Ertung" == Ertung Bora writes: elric AT wheel DOT ucdavis DOT edu (Jeffrey Taylor) writes: >Is there any requirement for argv[1] to be dereferencable if argc == 1? >If this were my program, I would guess I had gotten lucky on the OS and >check before I call fopen. Ertung> You look like pretty experienced programmer :). But As a Ertung> matter of fact, this is a test program to test the Ertung> different behaviours of standart C functions of different Ertung> compilers.And I am pretty sure your comment will Ertung> work. Thanks for advice anyway, it could help the Ertung> beginners. Unfortunately, I don't have a copy of the ANSI C standard. But for what it's worth, _Harbison & Steele_, p. 359 says: "The value of argv[argc] may be a null pointer, but it is not so in all implementations." Although I like _H & S_, I admit that it isn't authoritative by any means. But it does suggest that programs should avoid assuming that argv[argc] contains a legitimate value, and I'm inclined to believe them. -Mat