Hello, given a simple code: #include long hyp(long height, long base) { return sqrt(height * height + base * base); } int main(void) { long h = hyp(10, 20); return 0; } I compile this on Debian 4.0 (gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)): #gcc -ansi -pedantic -W -Wall -lm hyp.c As I understand, according to standard sqrt returns ...
Hello everyone, I'm migrating a C++ program from 32-bit systems to 64-bit systems. The old programmers used some annoying assignments like assigning "long" to "int", which may lead to data loss. Is it possible to let the compiler (specifically, GCC) spew some warnings on this kind of implicit type casts? Or you suggest use some other static source codes analysis tools? ...