lkml.org 
[lkml]   [1999]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q: void* vs. unsigned long
On Tue, 16 Feb 1999, Matti Aarnio wrote:

> > long long is defined in ISO C9X, your above definition is no longer true.
> >
> > C9X clearly states in 6.2.1.1:
> >
> > - The rank of long long int shall be greater than the
> > rank of long int, which shall be greater than the rank
> > of int, which shall be greater than the rank of short
> > int, which shall be greater than the rank of signed
> > char.
>
> Interesting, so this tells that:
>
> rank(long long int) > rank(long int) > rank(int) > rank(short int) > rank(char)
>
> While following was the previous definition:
>
> rank(long long int) >= rank(long int) >= rank(int) >= rank(short int) >= rank(char)

Rank is just for promotion and it's been this way since the original
standard. They're obviously not talking about size, as this would break
every single platform I've ever heard of, which have at least two of the
above the same size.

> Systems do exist where *all* of those have same size, but they are
> usually programmed in Fortran-9X, require liquid cooling, and recognize
> name "Cray" ...

More commonly, many DSPs have a single operand size. And they're quite
frequently programmed in C.

This is all silly though. What's important is are there any platforms we
care about where a void * will NOT fit in a long. The answer as far as I'm
aware is no. The reverse is not important as we'd be foolish to cast
something that wasn't intended to be used as a pointer to a pointer type.

Using per-arch types is, of course, the right way to do it for new code.
--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."



-
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/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.074 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site