<p>Test the following code:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
main()
{
    const char *yytext="0";
    const float f=(float)atof(yytext);
    size_t t = *((size_t*)&amp;f);
    printf("t should be 0 but is %d\n", t);
}
</code></pre>

<p>Compile it with:</p>

<pre><code>gcc -O3 test.c
</code></pre>

<p>The GOOD output should be:</p>

<pre><code>"t should be 0 but is 0"
</code></pre>

<p>But with my gcc 4.1.3, I have:</p>

<pre><code>"t should be 0 but is -1209357172"
</code></pre>

Use the compiler flag -fno-strict-aliasing.
With strict aliasing enabled, as it is by default for at least -O3, in the line:
```
```
size_t t = *((size_t*)&f);
```
```
the compiler assumes that the size_t* does NOT point to the same memory area as the float*. As far as I know, this is standards-compliant behaviour (adherence with strict aliasing rules in the ANSI standard start around gcc-4, as Thomas Kammeyer pointed out).
If I recall correctly, you can use an intermediate cast to char* to get around this. (compiler assumes char* can alias anything)
In other words, try this (can't test it myself right now but I think it will work):
```
```
size_t t = *((size_t*)(char*)&f);
```
```