ANSI C /K&R 2nd edition questions,...

Chris Torek torek at elf.ee.lbl.gov
Fri Apr 19 04:30:28 AEST 1991


>>>If there should be a general or common opinion that the 2nd edition of
>>>K&R is not adequate for knowing the ANSI standard, can anyone
>>>recommend something readable/usable?

In an article whose referent was deleted (not by me), I wrote:
>>There are plenty of books that purport to `boil down' the standard
>>into nice, easy, bite-sized bits, but none of them will give you the
>>Ultimate Answer to any question.

In article <memo.928061 at lynx.northeastern.edu>
cschmidt at lynx.northeastern.edu writes:
>[Plauger and Brodie recommendation]
>Consider a common example: The book "Standard C" includes a
>list of standard header files.  If you want to know whether one of the
>header files provided with your compiler can be counted on when you
>port your program to another ANSI C compiler, this book provides an
>answer.

Surely, and it is almost certainly correct as well.  I am not saying
that the books that `boil down' the standard are not useful, nor even
that they are not `all you need if you want to write ANSI C'.  But look
at the original question again:

	`What should I read so that I know the ANSI standard?'

The ONLY thing you can read that contains the ANSI C standard *is* the
ANSI standard, X3.159-1989.

If you want the Ultimate Answer to

	`what does  printf("%d %d\n", (v++, 0), (v++, 1));  do?'

(see comp.std.c), you have to look at the standard---any reasonable
book will just say `avoid this' (which is right).  The standard will
tell you, in very many words, whether you have violated a constraint,
invoked implementation-defined or undefined behavior, and so on.

Perhaps I am simply being overly literal with the original question,
but it seems *very* clear to me that the desire was `to know the ANSI
standard' rather than `to be able to use ANSI C portably, efficiently,
etc.'.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.lang.c mailing list