Possible duplicate:Can I warn GCC about passing too wide types to functions?
Many times I cause errors by passing a long integer function.
Can I get gcc to warn me when I do this?
Give it a try -Wconversion.
-Wconversion
int fn(int); int bar(long x) { return fn(x); } gcc -c t.c -Wconversion t.c: In function ‘bar’: t.c:3: warning: conversion to ‘int’ from ‘long int’ may alter its value