Xref: csiph.com comp.arch:33300 Newsgroups: comp.arch Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.glorb.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: The freedom that give us C++ and C Message-ID: Date: Sat, 30 Jan 2016 00:03:07 GMT References: Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 52 In article , David Brown wrote: >On 29/01/16 03:11, Mike Stump wrote: >> In article , >> David Brown wrote: >>> Anyway, the code will fail at compile time due to the non-existence of >>> the size-specific types. >> >> Nothing in the language standard requires that. :-) > >It requires the non-existence of the fixed size types if the >implementation does not have an appropriate standard or extended integer >type. Right, but this is different. The standard says: 4 For each type described herein that the implementation provides,224) shall declare that typedef name and define the associated macros. Conversely, for each type described herein that the implementation does not provide, shall not declare that typedef name nor shall it define the associated macros. An implementation shall provide those types described as ``required'', but need not provide any of the others (described as ``optional''). What this says is that the implementation is free to compile any type it chooses to implement. It is not required to fail to compile any type that it chooses to support. The point may seem subtle, but basically, an implementor is free to implement as many as he wants. You said, the code will fail to compile. It is only that certainty that I object to. The closest phrase I might go for would be: Anyway, the code will only fail at compile time only due to the non-existence of the size-specific types. >Of course, there is nothing to stop a system with a 36-bit "int" >having extended integer types for 16-bit and 32-bit, emulated with >instructions, masks, etc., as needed. Right. >Incidentally, why doesn't gcc make __int128 an "extended integer" so >that it can then define uint128_t and int128_t ? It seems like a >logical step. Wait, you mean like this: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html That isn't the right question, the right question is, why the heck don't we _always_ do this on every machine? Because we're exceedingly lazy or no one has contributed it yet, you're choice.