casting a pointer to integer issues warning on 64bit arch
问题 I'm writing a linux kernel module that makes use of the exported symbol open_exec struct file *open_exec(const char *name) It returns a pointer, and I can check for an error with the IS_ERR macro: if (IS_ERR(file)) return file; During compile time, I get this warning: warning: return makes integer from pointer without a cast This is because my function here returns an integer. If I try to cast it: return (int) file; I don't get a warning on my 32bit machine, but I do on my 64bit machine: