M
Mike Wahler
Dan Pop said:In <[email protected]> "Mike Wahler"
^^^^^^^^^^^^^^^^^^
That's a bold statement for code invoking undefined behaviour:
Yes, I "misspoke".
fangorn:~/tmp 427> cat test.c
#include <stdlib.h>
int main()
{
srand(time());
return 0;
}
fangorn:~/tmp 428> gcc -ansi -pedantic test.c
fangorn:~/tmp 429>
So, let's rephrase: "if the code includes <time.h>, the call you show
above should not compile without a diagnostic".
Yes, thanks.
If the author was sloppy enough to call srand(time()), it is a safe bet
that he was sloppy enough not to include <time.h>.
And I was sloppy with my reply. It's a safe bet that
someone will point it out when I am.
-Mike