Re: Constant byteorder macros.

From: Francois-Rene Rideau (fare@tunes.org)
Date: Fri Jan 21 2000 - 09:47:27 EST


On Fri, Jan 21, 2000 at 11:26:16AM -0300, Horst von Brand wrote:
>> [...] the whole point of a __constant_FOO macros is to stay independent
>> from GCC proper (since __builtin_constant_p is GNU C specific). If this
>> is a goal (and I guess it is, since we do have such interface in the
>> htonl case), then indeed, new interfaces have to be provided.
>
> The linux kernel is so tightly bound to gcc that this portability is
> moot. Perhaps the pervious ones are remnants from times where the kernel
> headers where directly used by userland, or workarounds for broken gcc
> versions?

Well, certainly the linux kernel as a whole is tightly bound to gcc
at the moment. But I can imagine lots of reasons why we wouldn't want
to be gratuitously non-portable:

* people may want to extract parts of the kernel to reuse them in
 other environments, with other compilers

* people may want to port the kernel to an (existing or future) architecture
 where gcc is not ported, or produces code much inferior to other compilers.

* people may want to feed kernel sources into automatic software analysis
 and transformation tools that only understand plain C, and not GNU C
 extensions.

* who knows? many other reasons.

Anyway, in such cases as this one where a satisfying patch is available,
it costs more to argue about the issue than to apply the patch. Doesn't it?

PS: if Alan, Linus, or another maintainer includes my clean-up patch
in next official (after testing it on variously-endianned architectures),
I'll be glad.

Your byteorder janitor,

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
[ TUNES project for a Free Reflective Computing System | http://tunes.org ]
There cannot be Ethics without Models of possible behaviors, and Imagination
to explore them. [Corollary: there is no Ethics for an all-knowing God,
but there are Ethics for mostly-ignorant but nevertheless thinking humans]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:25 EST