unsigned int doSomething(unsigned int *x, int y) { if(1) //works if(y) //reports the error given below //I use any one of the ifs above, and not both at a time return ((*x) + y); //works fine when if(1) is used, not otherwise } int main() { unsigned int x = 10; doSomething(&x, 1); }