> I experimented with something like this a while ago. The goal was to > have a -f{big,little}-endian switch that changes the default byteorder, > and also to add endianness attributes. It didn't go very far, but I > could compile some simple testcases and it seemed to behave as expected > for those.
OK, that seems to be more ambitious than what we have done. As a matter of fact, when we were discussing the specification of the feature, we tried to narrow it to something that we believe was reasonably implementable and maintainable in the long term, hence the more limited scope of our version. > The patch is attached for reference. The interesting problems are > byteswapping pointers and how to deal with function arguments; neither > is dealt with in this patch (except for a crummy attempt to get varargs > right). At the moment I don't intend to do further work on this. Thanks for posting the patch in any case! -- Eric Botcazou