Indeed. But for once, it's not MY fault :)
Linus made htonl back into a macro to take advantage of constant folding
(I had them extern inline const functions, but with __u32 instead of
unsigned long argument and result).
However, he forgot to test for optimization being enabled or not,
hence breaking userland ntohl users who don't inline functions.
The definitions of htonl and such as macros in linux/byteorder_generic.h
(moved to linux/byteorder/generic.h in my latestest patch) should be
surrounded with the same guard as constant folding in swab.h:
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
PS: would it be non-standard if htonl was defined a __const__ function?
PPS: please tell me if anything else breaks.
Sorry for the inconvenience,
== Faré -=- (FR) François-René Rideau -=- (VN) Уng-Vû Bân -=- rideau@ens.fr ==
Join a project for a free reflective computing system! | 6 rue Augustin Thierry
TUNES is a Useful, Not Expedient System. | 75019 PARIS FRANCE
http://www.eleves.ens.fr:8080/home/rideau/Tunes/ -=- Reflection&Cybernethics ==