2006-12-15 <>,
Richard Heathfield wrote:
> said:
>
> <snip>
>
>> Seems ANSI no longer supply the 89 version (not surprising),
>> https://global.ihs.com can supply hard copy only, and I can get it in
>> the book "The Annotated ANSI C Standard by Herbert
>> Schildt". The last seems to be the best choice.
>
> Provided you ignore the annotations, which are typically Schildtian, that's
> the cheapest and best way to get hold of the Standard, although the book
> does also contain at least one error in the text of the Standard itself.
> The details are on Clive Feather's page, "The Annotated Annotated ANSI C
> Standard", http://www.lysator.liu.se/c/schildt.html
Eh. Some of what that page says is a bit off.
} If main() is declared as void, I don't know of any compiler that will
} return 0. Indeed, the standard forbids it to !
The standard forbids no such thing. This is the most serious objection
I have, the rest of this post is just filler.
} if a signal can be raised within a library function (perhaps by an
} external event such as the user pressing a BREAK key), then the signal
} handler must not call that library function.
Is this really true for all library functions?
#include <signal.h>
void abrt(int) {
if(rand()%1) abort();
else _Exit(EXIT_SUCCESS); }
int main() {
signal(SIGABRT,abrt)
srand(time());
abort(); }
} There is no description of mktime and how it can be used to solve
} problems like "what day is 100 days after December 25th 1993 ?"
Is it really legal to add 100 days to a struct tm like this, or is it
just a consequence of the way common implementations work?