I am building a C library and I experience some awfully weird problems on the testing program...
I have an if () test and the program gets through no matter what the condition is.
below is the code:
Well, by stepping through the code (MSVC 6) I can clearly see that:
s = 0x00000000.
Now, either that does not mean NULL and I've gone fishing, either something weird is going on with the compiler.
Even more, no matter what condition I put there:
THE SAME THING HAPPENS! false is returned!
Even weirder, one step before, in the calling function, I have a redundant test, on the same variables:
and the call_buggy_code gets called.
I am petrified at this... Does anybody has any clue about this????
This started to occur a few minutes ago and it keeps rolling.
I am about to publish this on Guiness Book of Most weird
things on the planet...
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
I have an if () test and the program gets through no matter what the condition is.
below is the code:
Code:
s = ExistElementInCollection(col,id);
if (s)
return false;
Well, by stepping through the code (MSVC 6) I can clearly see that:
s = 0x00000000.
Now, either that does not mean NULL and I've gone fishing, either something weird is going on with the compiler.
Even more, no matter what condition I put there:
Code:
if (s != NULL), if (s == NULL), if (s), if (!s)
Even weirder, one step before, in the calling function, I have a redundant test, on the same variables:
Code:
if (ExistElementInCollection(col,id))
do_something
else
call_buggy_code
I am petrified at this... Does anybody has any clue about this????
This started to occur a few minutes ago and it keeps rolling.
I am about to publish this on Guiness Book of Most weird
things on the planet...
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro