Basically I work on MFC and Win Platform where the code is compile time error
Code:
int main(){
int *ptr=malloc(10);
return 0;
}
and so never came across such hidden error.

Thanks for clearing the doubts.