'lex' with argc > 2 (was Re: Why isn't argv[argc]==(char *)0 ?)

Martin Weitzel martin at mwtech.UUCP
Wed Nov 22 07:09:37 AEST 1989


In article <3053 at cello.UUCP> dcm at toysrus.UUCP (dcm) writes:
[lines deleted]
>Argc should always be correct.  Who cares about argv[argc]?
Many many existing programs do!

Now my question to all *real* wizards: The man page for 'lex'
states, that there may be more than one file argument. Besides,
that this doesn't seem to be of much worth (a rather crude include
mechanism?), it doesn't work on most system (core dump or worse++).

The interesting part is, that this bug must be very old, because
you can find it in very different ports of SysVs (680*0 as well as
80*86) but also in different flavours of XENIXs. Does anyone know,
how and when this bug went into 'lex' and if some port of UNIX has
allready fixed it. (Maybe, the problem is related to the change from
argv[argc] == -1 to argv[argc] == 0 with the transition from V6 to
V7, I just learned about from the discussion here.)

[++ I've used even a XENIX-Implementation for an 80186 - a CPU with
insufficient memory protection - where this particular bug causes
crashes the systems completly ...]

Please E-Mail, I'll post a summary ... Martin Weitzel (martin at mwtech.UUCP)



More information about the Comp.unix.wizards mailing list