Ken Brody <
kenb...@spamcop.net> writes:
[...]
> Note that it's quite possible to remove a header file, have the program
> compile and link without errors (though perhaps with warnings), and fail to
> run because of the missing header.
>
> Ignoring the "let's cast malloc() to get rid of the type mismatch warning"
> scenario, what about something as simple as:
>
> fseek(f,0,0);
>
> If sizeof(int)!= sizeof(long), the above will most likely fail at runtime.
[...]
Calling a function with no visible declaration is a constraint violation
as of C99; in principle, that's just as bad as a syntax error.
Unfortunately, a lot of compilers either don't complain about such
things, or don't complain (IMHO) vociferously enough.
--
Keith Thompson (The_Other_Keith)
ks...@mib.org <
http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"