Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 20:08:55 -0600
From:      "Jacques A. Vidrine" <n@nectar.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        Brad Knowles <brad.knowles@skynet.be>, "Michael C . Wu" <keichii@peorth.iteration.net>, j mckitrick <jcm@FreeBSD-uk.eu.org>, freebsd-chat@FreeBSD.ORG
Subject:   Re: bad programming practice?
Message-ID:  <20010224200855.B31832@spawn.nectar.com>
In-Reply-To: <200102242014.NAA23639@usr05.primenet.com>; from tlambert@primenet.com on Sat, Feb 24, 2001 at 08:14:50PM %2B0000
References:  <20010224090425.A30456@spawn.nectar.com> <200102242014.NAA23639@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 24, 2001 at 08:14:50PM +0000, Terry Lambert wrote:
> > > (personally, I still think there should be sized types, 
> > 
> > Do you mean as in <stdint.h>, or something else?
[snip]
> The language needs sized types, since it's intended to be capable
> of mapping hardware, directly.
[snip]
> For things you don't care about, there need to be "at least"
> sizes; this lets the machine pick a "preferred" size for both
> registers and bus transfers.

These are things that C99's <stdint.h> seem to provide.  Excerpt 
from ISO 9899:1999 section 7.18:
 
  1  The header <stdint.h> declares sets of integer types having 
     specified widths, and defines corresponding sets of macros.
     It also defines macros that specify limits of integer types 
     corresponding to types defined in other standard headers.
  2  Types are defined in the following categories:
	 integer types having certain exact widths;
	 integer types having at least certain specified widths;
	 fastest integer types having at least certain specified widths;
	 integer types wide enough to hold pointers to objects;
	 integer types having greatest width.

e.g.

  uint24_t i286addr;
  uint_least16_t offset;
  int_fast16_t accum;

Unfortunately, many of these types are optional, and I guess GCC doesn't supply
a stdint.h yet.  
-- 
Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010224200855.B31832>