title: Can I get the behavior of -Wfloat-equal for all comparisons except literal zero?
body: <p>I'd like to enable -Wfloat-equal in my build options (which is a GCC flag that issues a warning when two floating pointer numbers are compared via the == or != operators). However, in several header files of libraries I use, and a good portion of my own code, I often want to branch for non-zero values of a float or double, using <code>if (x)</code> or <code>if (x != 0)</code> or variations of that.</p>
  
  <p>Since in these cases I am absolutely sure the value is exactly zero - the values checked are the result of an explicit zero-initialization, <code>calloc</code>, etc. - I cannot see a downside to using this comparison, rather than the considerably more expensive and less readable call to my <code>near(x, 0)</code> function.</p>
  
  <p>Is there some way to get the effect of <code>-Wfloat-equal</code> for all other kinds of floating point equality comparisons, but allow these to pass unflagged? There are enough instances of them in library header files that they can significantly pollute my warning output.</p>