🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4938

Re: Coding Standards are ignorant

#4938
From: Mike Rubenstein
Date: Sat, 23 Mar 1996 05:20
37 lines
2303 bytes
jcoffin@rmii.com (Jerry Coffin) wrote:

> In article <danpop.827188302@rscernix>, danpop@mail.cern.ch says...
> > In <MIB.96Mar18105957@gnu.ai.mit.edu> mib@gnu.ai.mit.edu (Michael I. 
> Bushnell, p/BSG) writes:
> > 
> > >You are not guaranteed that long is the widest integral type.  
> > 
> > Yes, you are.  ANSI classic 3.1.2.5:
> > 
> >     There are four signed integer types, designated as signed char, 
> >     short int, int, and long int.
> > 
> > The standard doesn't leave any place for extensions here.
> 
> Uless I'm missing something, extensions shold be perfectly legal at least if 
> their names are in the implementor's name space, or are in the user's name 
> space only if a non-standard header in included, a pragma is used, etc.
> 
> I can't see any way for a strictly conforming program to be affected by the 
> compiler supporting something like _VeryLong or __int128.  Have I missed 
> something obvious?

You've missed a rather subtle point.  Such extensions are legal but
they do not introduce integer types.  The standard defines the signed
integer types as being signed char, short int, int, and long int (and
similarly for unsigned integer types).  An implementation may
introduce new types that behave like integers, but according to the
standard they are not integer types.

This is important since it guarantees, for example, that size_t is
unsigned char, unsigned short, unsigned int, or unsigned long.  An
implementation cannot define size_t as being unsigned _VeryLong
(assuming, of course, that unsigned _VeryLong is a new type).


Michael M Rubenstein
Technical Details
Message-ID: <31536199.219868914@nntp.ix.netcom.com>
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
References: <4gum82$14v4@info4.rus.uni-stuttgart.de><MIB.96Mar15170902@gnu.ai.mit.edu><wyraut5fqq.fsf@dns.bluesky.net><MIB.96Mar16174948@gnu.ai.mit.edu><4ifq40$i87@sundog.tiac.net><MIB.96Mar18105957@gnu.ai.mit.edu><danpop.827188302@rscernix> <MPLANET.31530e9djcoffin98993e@news.rmii.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
From: miker3@ix.netcom.com (Mike Rubenstein)
Newsgroups: comp.std.c
Subject: Re: Coding Standards are ignorant
Date: Sat, 23 Mar 1996 05:20:26 GMT
Organization: Netcom
Message-ID: <31536199.219868914@nntp.ix.netcom.com>
References: <4gum82$14v4@info4.rus.uni-stuttgart.de><MIB.96Mar15170902@gnu.ai.mit.edu><wyraut5fqq.fsf@dns.bluesky.net><MIB.96Mar16174948@gnu.ai.mit.edu><4ifq40$i87@sundog.tiac.net><MIB.96Mar18105957@gnu.ai.mit.edu><danpop.827188302@rscernix> <MPLANET.31530e9djcoffin98993e@news.rmii.com>
NNTP-Posting-Host: ix-dc11-22.ix.netcom.com
X-NETCOM-Date: Fri Mar 22  9:19:52 PM PST 1996
X-Newsreader: Forte Agent .99d/32.182