🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.powerpc
Article #20

Re: 64-bit

#20
From: Peter Moulder
Date: Mon, 04 Dec 1995 04:42
34 lines
2090 bytes
Lawrence Kirby (fred@genesis.demon.co.uk) wrote:

>These seem rather pointless (other than uint32). sint16 is to all intents and
>purposes equivalent to short. 

I suppose there may (in the future, perhaps) be a compiler on which short is 
more than 16 bits; occasionally you do want something to be exactly n bits.

>schar8 can't be anything other than signed char.

A char is guaranteed to be a byte, large enough to hold a character of the
native character set.  A byte is usually [but not always] 8 bits.
I'm sorry I can't find my K&R at the moment, so someone can correct me if
they like.  (It's on about p32 or earlier, I think.)

I confess I've never used a compiler where a short wasn't 16 bits and a 
char 8; however, the standard does at least leave room for the suggested 
types to be useful.

>To use the language (or at least the standard library) effectively you
>ultimately need to know what the underlying type is. fprintf and fscanf
>conversion specifiers are the most clear example of this.

One solution I've used in the past is to cast to or from a long.  There can 
still be problems with this, though.

pjm.


>By trying to cover
>up the underlying types you are ultimately asking for trouble, especially
>when the basic language itself provides the tools to write portable code.
>To effectively support that sort of usage you need a language with stronger
>typing, such as one derived from PASCAL, or possibly C++'s OO support.
Technical Details
Message-ID: <49tu81$jcf@otis.netspace.net.au>
Path: arc1-ca.pugleaf.net!news.netspace.net.au!reiter
References: <MEISSNER.95Nov9091407@tiktok.cygnus.com> <47tbel$tta@rs18.hrz.th-darmstadt.de> <483pe6$aft@spool.cs.wisc.edu> <wkdrSOS00YUsM7OxBb@andrew.cmu.edu> <48bjig$rgj@inca01.inca.co.nz> <816741669snz@genesis.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.netspace.net.au!reiter
From: reiter@netspace.net.au (Peter Moulder)
Newsgroups: comp.sys.powerpc,comp.lang.c
Subject: Re: 64-bit
Followup-To: comp.sys.powerpc,comp.lang.c
Date: 4 Dec 1995 04:42:41 GMT
Organization: NetSpace Online Systems
Message-ID: <49tu81$jcf@otis.netspace.net.au>
References: <MEISSNER.95Nov9091407@tiktok.cygnus.com> <47tbel$tta@rs18.hrz.th-darmstadt.de> <483pe6$aft@spool.cs.wisc.edu> <wkdrSOS00YUsM7OxBb@andrew.cmu.edu> <48bjig$rgj@inca01.inca.co.nz> <816741669snz@genesis.demon.co.uk>
NNTP-Posting-Host: netspace.net.au
X-Newsreader: TIN [version 1.2 PL2]