Re: somebody dropped a (warning) bomb

Linus Torvalds
2007-02-09T15:39:42Z

On Thu, 8 Feb 2007, David Rientjes wrote:
>
> Yes, I read the 4.1.1 docs:
>
> By default, such a bit-field is signed, because this is
> consistent: the basic integer types such as int are signed
> types.

Ok, so the gcc people have added some language. So what? The fact is, that
language has absolutely nothing to do with the C language, and doesn't
change anything at all.

> That is the whole basis for my argument, when you declare something "int,"
> most programmers would consider that to be SIGNED regardless of whether it
> is 32 bits, 13 bits, or 1 bit.

And MY argument is that YOUR argument is CRAP.

The fact is, signs of bitfields, chars and enums aren't well-defined.
That's a FACT.

Your argument makes no sense. It's like arguing against "gravity", or like
arguing against the fact that the earth circles around the sun. It us
STUPID to argue against facts.

Your argument is exactly the same argument that people used to say that
the earth is the center of the universe: "because it makes sense that
we're the center".

The fact that "most programmers" or "it makes sense" doesn't make anything
at all true. Only verifiable FACTS make something true.

There's a great saying: "Reality is that which, when you stop believing in
it, doesn't go away." - Philip K Dick.

So wake up and smell the coffee: reality is that bitfields don't have a
specified sign. It's just a FACT. Whether you _like_ it or not is simply
not relevant.

The same is true of "char". You can argue that it should be signed by
default, sicne "short", "int" and "long" are signed. But THAT IS NOT TRUE.

Arguing against reality really isn't very smart.

Linus