Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!uw-beaver!Teknowledge.COM!unix!hplabs!motsj1!mcdchg!ddsw1!olsa99!mje From: mje@olsa99.UUCP (Mark J Elkins) Newsgroups: comp.unix.wizards Subject: Re: Why isn't argv[argc]==(char *)0 ? Summary: But 'argv[argc] == (char *)0' on X/OS (Olivetti Unix) Keywords: X/OS, Olivetti, LSX, coredump Message-ID: <8@olsa99.UUCP> Date: 14 Dec 89 16:20:30 GMT References: <547.nlhp3@oracle.nl> <1989Nov16.012439.6405@virtech.uucp> <2673@auspex.auspex.com> Organization: Olivetti Africa Lines: 57 In article <2673@auspex.auspex.com>, guy@auspex.auspex.com (Guy Harris) writes: Guy >>>(I.e., unless you have to deal with an archaic UNIX or a Mutant UNIX Guy >>>From Hell, you can count on argv[argc] == 0.) In article <1635@ctisbv.cti-software.nl> Pim Zandgerger wrote... Pim >>In X/OS, a SYSV/BSD hybrid operating system for the Olivetti LSX Pim >>minicomputers, a reference to argv[argc] will make your program dump core. > If you mean "a *de*reference *of* 'argv[argc]' will make your program > dump core", that's true on Suns as well, and some other machines, since > they don't let you dereference null pointers. > > If you mean "even trying to copy the (pointer) *value* somewhere else > causes a core dump", then I think the label "Mutant UNIX From Hell" is > well-deserved; I've nothing against, say, array bounds-checking, but > "argv" has "argc+1" elements, not "argc" elements - if Olivetti intends > to get POSIX or ANSI C support on the LSX, they'd better fix this.... Mark Elkins writes.... OK Guys - I am the support person for Olivetti Africa and was a little upset about the accusation. I ran the following program... (Called 'e.c') main(ac,av) int ac; char *av[]; { char *cp; printf("Value of av[ac] = %s\n",av[ac]); cp = av[ac]; printf("Value of cp = %s\n",cp); while (ac >= 0) printf("Arg %d = %s\n",ac--,*av++); } and it produced..... Value of av[ac] = (null) Value of cp = (null) Arg 4 = e Arg 3 = one Arg 2 = two Arg 1 = three Arg 0 = (null) The Machine is a LSX 3020 Machine (68020 @ 17 Meg) running X/OS Rel 2.1 (Olivetti's Unix - Bastardisation of Sys V Rel 3.0 and BSD 4.2 - peppered with Olivetti features) Go suck eggs (or maybe upgrade your system) (Any replies - please mail mje@olsa99 - my news feed is down) -- . . ___. .__ Olivetti Africa, Unix 'Everything-except-sales' /| /| / /__ UUCP: uunet!olsa99!mje (Mark J Elkins) / |/ |ARK \_/ /__ LKINS mje@olsa99.UUCP - Living in GMT-2