Subject: Re: Tcl7.5 and NetBSD-current
To: Peter Seebach <seebs@solon.com>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 02/27/1996 23:48:18
> It's nonconforming because it's an extension which is also a syntax
> error.  If the compiler were warning for that always, it could be
> a conforming implementation, but it would be very hard to write conforming
> code.  (all it has to do is warn; it is not required to *reject* long long.)

It wouldn't be hard, just tedious ;-).  (If only the compiler accepted
__int64...)

> Unless we're using off_t in a stdio function, in which case, our
> implementation is really broken.  The list of integral types is exhaustive,
> at least for purposes of the standard library.  If any standard library
> function is taking or requiring arguments not of standard types, we lose.

off_t is only used for lseek(), which is not ANSI C (does anyone have a POSIX
standard handy?).  fseek() takes long, the bare, unadorned, untypedef'ed
integral type, just like it should, and fsetpos/fgetpos take fpos_t, the
magical opaque cookie whose type may be anything an implementation desires,
including an _int64.  (One annoying thing about the standard integral types
being exhaustive (but ONLY for the purposes of the standard) is that size_t
is required to be one of the listed types; you can't conveniently have 32 bit
longs and 64 bit pointers (unless you limit the size of individual objects to
32 bits).

> (%qd is a legal extension; the code using it is invoking undefined behavior,
> but that's ok, it just means the code is only conforming, not strictly
> conforming.)

I can't find my copy of the standard, but I *think* %qd actually isn't
a legal extension; I think the standard reserved the lowercase letters,
requiring conforming implementations to use uppercase letters.  It is
splitting a hair, though, because no strictly conforming C program can
tell the difference.

Ah, "conforming code".  Sometime I want to modify a copy of the C compiler
to detect a number as being the first token in a file, so that it can then
print an appropriate diagnostic message and then exec a BASIC interpreter.
By the rules of the standard, that would then turn every BASIC program in
the world into a "conforming C program" -- a C program which is accepted by
some (any) conforming C compiler!

Well, every *conforming* BASIC program, anyway.  Bwahahahah!