Okay, say I have a function foo that returns a pointer to an object of type dataType. This function will either return NULL or a pointer to an object.
I want to test if the return value is NULL or not. I use code something like this:
Code:
if (foo() == NULL) {
//do something
}
Now, the code in question does what I want it to, I'm just getting this pesky warning:
Code:
warning: NULL used in arithmetic
What's this all about? I want to fix whatever it's warning me about, but I don't see what's wrong with it.
EDIT: I can post actual code if that will help, this is just mockup of what the situation is.
Bookmarks