When compiling a C program in Visual Studio 2013 the following may produce different results:
#include <math.h>
void bar(void) {
double f = fabs(-1.0);
/* f is 1.0 */
}
and
void foo(void) {
double f = fabs(-1.0);
/* f is 0 */
}
and the same snippet without including math.h. When omitting the include, the compiler does not report an error and assumes fabs has the following signature int fabs().
Is there anyway to force the compiler to report this as an error or even a warning?