Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC840302); site chalmers.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!mcvax!enea!chalmers!augustss
From: augustss@chalmers.UUCP (Lennart Augustsson)
Newsgroups: net.lang.c
Subject: Re: 2nd Annual Obfuscated Contest Winners
Message-ID: <302@chalmers.UUCP>
Date: Fri, 28-Jun-85 18:50:28 EDT
Article-I.D.: chalmers.302
Posted: Fri Jun 28 18:50:28 1985
Date-Received: Fri, 5-Jul-85 03:43:05 EDT
References: <2902@nsc.UUCP> <36@bbnccv.UUCP>
Reply-To: augustss@chalmers.UUCP (Lennart Augustsson)
Distribution: net
Organization: Dept. of CS, Chalmers, Sweden
Lines: 38

[I really shouldn't spend more time on these silly programs.]

In article <36@bbnccv.UUCP> keesan@bbnccv.UUCP (Morris M. Keesan) writes:
>1. The most obscure program:
>(submitted by Lennart Augustsson  )
>
>is not legal C, even though the 4.2BSD compiler (and presumably other PCC-based
>compilers) processes it as the author apparently intended.
....
>A little examination reveals that the error reduces to
>
>    expr ? expr , expr : expr
>
I actually didn't think it would work, but I tested removing the parenthesis
around the (expr,expr) and it still worked!  So, since the purpose was to
produce an obscure program I kept them removed (another reason was that
the program was a bit to long at that moment).

>The program further violates K&R C (although it is legal according to all
>versions I've seen of the proposed ANSI spec, and also according to the
>System V documentation) by using structure member names non-uniquely; i.e.
>the structure member a is used both as an int and as a function pointer,
>and b is used as an int and as a structure pointer [ K&R p. 197: ". . . the
>same member may appear in two different structures if it has the same type in
>both . . ." ].  V7 C compilers blow up on this, complaining of redeclaration
>of a and b.
Since this seems to be an accepted extension to C I don't think it requires
any defense.

BTW, the program contains another non-portable construction: b / 2 where
b is negative, this may cause problems on some machines.

-- 
Any resemblance of the opinions above to real opinions, living or dead,
is purely coincidential.
	Lennart Augustsson
UUCP:		{seismo,philabs,decvax}!mcvax!enea!chalmers!augustss
ARPA,CSnet:	augustss@chalmers.csnet