[Simh] An abandoned piece of K&R C

Leo Broukhis leob at mailcom.com
Fri Nov 3 01:14:42 EDT 2017


https://retrocomputing.stackexchange.com/q/4965/4025


In the UNIX V7 version of the C language, there were the /\ (min) and the
\/ (max) operators. In the source of the scanner part of the compiler,

case BSLASH:
    if (subseq('/', 0, 1))
        return(MAX);
    goto unkn;

case DIVIDE:
    if (subseq('\\', 0, 1))
        return(MIN);
...

However, attempting to use them reveals that the corresponding part in the
code generator is missing. Trying to compile

foo(a, b) { return a \/ b; }

results in

1: No code table for op: \/

The scanner piece survived in the copies of the compiler for various
systems for several years. I tried to look for copies of the code generator
table which would contain an implementation, but failed. Has anyone ever
seen a working MIN/MAX operator in K&R C?

Thanks,Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20171102/26c4a66d/attachment.html>


More information about the Simh mailing list