This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: long long vs long


Graham Murray wrote:
> 
> This is probably a silly question, but rather than having long long for
> 64 bit, why was long not made 64bit? The standard (AFAIK) states that
> short <= int <= long.  So, it should be possible for long to be 64 bit
> rather than 32. This would give a simple progression from 8bit chars to
> 64bit longs.

You're right, it is a silly question.  ~:^)  I did a lot of 64bit unix
kernel porting work a few years back, and the reason that something
other than 'long' had to be used is that there is about 6 trillion lines
of C code in the world that would seriously break if long's suddenly
became 64 bits, because coders have been using 'long' for more than a
decade with the belief that they are the same size as 'int'.  Avoiding
the discussion of why they didn't use 'int' all those times, suffice it
to say that a new type was created for the sake of expediency.  Everyone
who has written code that might require some fixin' if long's changed to
64 bits, raise your hand.

The irony is that types like 'long long' are usually accomplished in
some basic header, not as a base compiler type.  The base compiler 64bit
types are almost always of the form '_int64' or some such.  It seems we
just can't ever separate int's and long's!

a
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]