Originally Posted by
tretton
Are you guys serious? I mean, it compiles without a single warning, it's just Splint that is a bit stingy. The prototype for pow() is double pow(double b, double p), so if I have two ints, a and b, and call pow(a, b) - this is bad?
Another point of view:
Code:
#include <math.h>
double foo(int a, int b)
{
return pow(a, b);
}
Code:
test.c 5 error [Info 747] Significant prototype coercion (arg. no. 1) int to double
test.c 5 error [Info 747] Significant prototype coercion (arg. no. 2) int to double
Explanation in manual:
747 Significant prototype coercion (Context) Type to Type -- The type specified in the prototype differed from the type provided as an argument in some significant way. Usually the two types are arithmetic of differing sizes or one is float and the other integral.
This is flagged because if the program were to be translated by a compiler that does not support prototype conversion, the conversion would not be performed.
So PC-lint flags this diagnostic as informational, and informs me of a potential error. Whether or not I as a programmer choose to understand the issue and/or correct it is up to me.