assertion warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux