This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
assertion warnings
- From: bill <bill dot pursell at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 15 Nov 2005 20:19:01 +0000
- Subject: assertion warnings
Is there any way to get gcc to generate warnings for the following code?
-Wall gives no complaints at all.
I expect that it's asking too much to get a warning for the first
assertion, but
the other two seem to be pretty obvious candidates for a warning.
#include <assert.h>
int
foo(int *x)
{
*x = *x+1;
return *x;
}
int
main()
{
int x;
assert(foo(&x));
assert(x=2);
assert(x++);
return 0;
}