Stanislav Sedov schrieb:
On Sun, 17 May 2009 14:36:03 +0200
Christoph Mallon <christoph.mal...@gmx.de> mentioned:

Aliasing behavior is stritcly described in
ISO C99 standard, so there's a good point to enforcing strict-aliasing clear
code in our kernel.
If you like this addition because of this reason, I have to disappoint you: This addition has absolutly *nothing* to do with strict-aliasing.


I didn't meant I like this change only from aliasing point of view: certianly,
the code readability argument is very important. But this change also
works towards the strict aliasing problem solving too: there's just
a less chance someone will reuse a variable, address of which was
previously taken.

Something like this would violate strict-aliasing:
int i;
short* p = (short*)&i;
A short pointer may never point at an int object (ISO/IEC 9899:1999 (E) ยง6.5:7).

The suggested paragraph has nothing to do with strict-aliasing. It's "just" about reusing the same variable in different contexts. Reusing the same variable in different contexts is bad, because it's harder for a human reader to identify the def-use-chains and additionally if the address of the variable has escaped (just a "normal" alias problem, nothing about type-punning and strict-aliasing) the generated code will be worse.

Please, can we stop this now? It was already rejected. It's a pity, but maintaining status quo for style(9) seems to be too holy. *sigh*

        Christoph
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to