#include <assert.h>Shows the warning.
int main() {
int a=1;
assert(a==1);
return 0;
}
#include <assert.h>Now, 'a' is a global variable, so the compiler can't know if the assertion will succeed or not, resulting in no warning.
int a=1;
int main() {
assert(a==1);
return 0;
}
void example( int exa_one, char *exa_two, (some struct) *exa_three )
{
assert( exa_one >= 0 );
assert( exa_two );
assert( exa_three );
(stuff)
}
I'd expect there to be a compiler option for it, but I'm at a loss as to what it would be. :thinking: