title: Make C floating point literals float (rather than double)
body: <p>It is well known that in C, floating point literals (e.g. <code>1.23</code>) have type <code>double</code>. As a consequence, any calculation that involves them is promoted to double.</p>
  
  <p>I'm working on an embedded real-time system that has a floating point unit that supports only single precision (<code>float</code>) numbers. All my variables are <code>float</code>, and this precision is sufficient. I don't need (nor can afford) <code>double</code> at all. But every time something like</p>
  
  <pre><code>if (x &lt; 2.5) ...
  </code></pre>
  
  <p>is written, disaster happens: the slowdown can be up to two orders of magnitude. Of course, the direct answer is to write</p>
  
  <pre><code>if (x &lt; 2.5f) ...
  </code></pre>
  
  <p>but this is so easy to miss (and difficult to detect until too late), especially when a 'configuration' value is <code>#define</code>'d in a separate file by a less disciplined (or just new) developer.</p>
  
  <p>So, is there a way to force the compiler to treat all (floating point) literals as float, as if with suffix <code>f</code>? Even if it's against the specs, I don't care. Or any other solutions? The compiler is gcc, by the way.</p>