Re: Typedefs / gcc / HIGHMEM

From: Stephan von Krawczynski (
Date: Sat Dec 08 2001 - 19:39:03 EST

> > The first is u64, the second u32. Either the u64 value is not
> > required, or the statement is broken. Astonishing there is _no_
> > compiler warning in this line.
> >
> Why should there be? The u32 value gets promoted to u64 before the
> comparison is done.
Yes, ok, you're right. This was not a well thought out statement.
Anyway the problem with printf statement stays. It is obviously
confused by a unsigned long long and "%08x". How would you fix this?
Downcasting to u32?
> > BTW, my personal opinion to "typedef unsigned int u32" is that it
> > should rather be "typedef unsigned long u32", but this is
> I see you have a background in environments where you move between
> and 32-bit machines. Guess what, in Linux the major movement is
> between 32- and 64-bit machines, and "unsigned int" is consistent,
> whereas "unsigned long" isn't (long is 32 bits on 32-bit machines,
> bits on 64-bit machines.)
Ha, I always wondered what this u64 is all about :-)
Honestly, this whole datatyping is gone completely mad since the 16-32
bit change. In my opinion
byte is 8 bit
short is 16 bit
long is 32 bit
<callwhatyouwant> is 64 bit (I propose long2 for expression of bitsize
long * 2).
<callwhatyouwant2> is 128 bit (Ha, right I would call it long4)
char is the standard representation of chars in the corresponding
environment, currently sizeof(byte).
int is the same and should move from 16 bit to 32 bit to 64 bit
depending on the machine. I mean whats the use of an int register in a
64bit environment, when datatype int is only of size 32 bit? This is
How do you call a 64 bit datatype in a 128 bit environment? According
to your / the worlds current terminology long will then be 128 bit and
int will (ridiculously) still be 32 bit. It will be pretty interesting
to hear people talking about integer registers and people writing
portable applications do #define int long ... A wait this will break
your #typedef unsigned int u32 story :-)
Writing portable applications can be easily done by using "meta"
datatype char/int/etc., whereas machine dependant coding could be done
by byte/short/long/long2/etc.
This is completely consistent as it _never_ changes.
Now you have an _additional_ layer where you call the stuff
u8/u16/u32/u64, which I find still ok, but you can then completely
shoot long/short/byte.
But, in fact, this is more a discussion for the RMS-world than for
L-world :-)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:13 EST