News for hackers. Stuff that matters.
Re:The Ten Commandments for C Programmers (Annotated Edition) by nitrogen on Monday November 08, 2010 @06:49PM (#1884565)
There are ways of fixing the warnings so you can use -Werr. For signed/unsigned, just change the type of one side of the comparison, or cast to whichever type is most correct for the comparison while manually making sure that you won't have any range issues. For your limited range example, you could probably use the preprocessor:

      ssize_t i;
  #if SSIZE_MAX != INT_MAX
      assert(i <= INT_MAX);
  #endif /* SSIZE_MAX != INT_MAX */
      f(i);

There are no comments on this comment yet.