microsoft C considered stupid

flaps at utcs.UUCP flaps at utcs.UUCP
Thu Jun 26 19:21:07 AEST 1986


In article <1986Jun20.01:10:46.477 at utcs.uucp> I write words which I have come
to eat, namely that microsoft is to blame for adding #if defined(macro_name) to
C and that this is a useless extension.  Uncomfortably many people have pointed
out to me that microsoft did not in fact make the addition and that it is in
fact useful for compound conditions.

In article <1566 at brl-smoke.ARPA> gwyn at brl.ARPA calls me "ignorant" and
observes that "It is not clear that Rosenthal *has* learned C" and seems not
to understand my complaint about the manual section concerning struct
declarations explained below.  (The other flamers were polite.)  He also
explains that it is #if defined(macro_name) rather than (manifest_constant).
I believe that the microsoft manual is in error here, but I forgot to check
this earlier this evening.

What I did check from the microsoft manual (Microsoft C Language Reference,
copyright 1984, 1985 by Microsoft Corporation, document number 8416L-300-00),
is their explanation of the struct declaration.  On page 57 they offer the
following two syntaxes for struct declarations:

   struct [tag] {member-declaration-list} declarator [, declarator...];
   struct tag declarator [, declarator...];

Now neither one of these can generate the frequent declarations of the form:

	struct record {
		char data[80];
		struct record *next;
	};

, as this is missing a non-optional "declarator".  Almost needless to say,
this ridiculous restriction is not actually enforced by the compiler.
However, on page 59 there are five examples none of which involves a style
similar to my struct record declaration above, so it would appear that the
writers of the manual are unaware of this syntax or have ulterior motives
for not writing it down.

On page 55, enum declarations are defined in exactly the same way which I
believe is equally erroneous.

Furthermore, I believe that it would be a big mistake to remove #ifdef from
the language, because it is still being widely used, and unlike the reserved
word question (if you add reserved words to the language you restrict it, in
a sense), removing #ifdef would allow no new programs (such as, for example,
removing 'entry' would, because you could then call a variable 'entry').

--
Alan J Rosenthal
{decvax|cbosgd|linus}!ihnp4!utcs!flaps, utzoo!utcs!flaps



More information about the Comp.lang.c mailing list