By: Ricardo B (ricardo.b.delete@this.xxxxx.xx), October 30, 2006 6:52 am
Room: Moderated Discussions
Gabriele Svelto (gabriele.svelto@gmail.com) on 10/30/06 wrote:
>And then there's another thing. About the unaligned load/store stuff. While this
>might make the coder's life easier, especially when dealing with hardware / wire
>protocols and the like one should be well aware that no language I know of supports
>them directly apart from assembler. C doesn't support unaligned loads/stores, they
>break the strict aliasing rules so if you're writing C which deliberately unaligns
>pointers (or accesses unaligned fields, whathever) you must be very much aware that
>your code is not portable in the best case and plain broken in the worst one. And
>we're not talking about theory, recent versions of GCC (especially the 4.1.x branch)
>which are exploiting strict aliasing more and more are starting to break a lot of code even with -O2 ...
>
>Gabriele
I'm afraid you're about to be called a "language lawyer". :)
>And then there's another thing. About the unaligned load/store stuff. While this
>might make the coder's life easier, especially when dealing with hardware / wire
>protocols and the like one should be well aware that no language I know of supports
>them directly apart from assembler. C doesn't support unaligned loads/stores, they
>break the strict aliasing rules so if you're writing C which deliberately unaligns
>pointers (or accesses unaligned fields, whathever) you must be very much aware that
>your code is not portable in the best case and plain broken in the worst one. And
>we're not talking about theory, recent versions of GCC (especially the 4.1.x branch)
>which are exploiting strict aliasing more and more are starting to break a lot of code even with -O2 ...
>
>Gabriele
I'm afraid you're about to be called a "language lawyer". :)