chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] long pointer equivalent


From: Perry E. Metzger
Subject: Re: [Chicken-users] long pointer equivalent
Date: 18 Aug 2002 12:28:31 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"Perry E. Metzger" <address@hidden> writes:

> Peter Keller <address@hidden> writes:
> > On Sat, Aug 17, 2002 at 08:55:06PM -0400, Perry E. Metzger wrote:
> > > Don't forget "long long". On many platforms, things like off_t's are
> > > long longs...
> > 
> > Technically, "long long" is a lie. :) It isn't in the ANSI spec,
> 
> Yes it is. Read the C99 document. Want me to quote chapter and verse?

Ah, what the hey. I happened to have it around

Section 6.2.5, "Types", Paragraph 4, first sentence:

   There are five standard signed integer types, designated as signed
   char, short int, int, long int, and long long int.

For completeness I will also note Paragraph 10:

   There are three real floating types, designated as float, double, and
   long double.

I believe "long double" is also new.

C99 also adds a complex type.

Anyway, many OSes, like NetBSD, now have 64 bit base types in their
APIs. This is of considerable use because you want to be able to
do things like lseek'ing in files larger than 2^31 bits. (NetBSD's
off_t type has been 64 bits for a decade, in fact.)

You might ask how one is supposed to portably refer to a particular
number of bits, given that a particular platform might have longs of
32 bits or 64 bits or whatever. The mechanism is that <stdint.h> is
supposed to define type various types for use by the user that satisfy
this requirement (quoting the standard again):

7.18.1.1 Exact-width integer types

1 Each of the following types designates an integer type that has
  exactly the specified width. These type names have the general form of
  intn_t or uintn_t where n is the required width. For example, uint8_t
  denotes an unsigned integer type that has a width of exactly 8 bits. 

2 The following designate exact-width signed integer types:
      int8_t int16_t int32_t int64_t

  The following designate exact-width unsigned integer types:
      uint8_t uint16_t uint32_t uint64_t

-- 
Perry E. Metzger                address@hidden
--
"Ask not what your country can force other people to do for you..."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]