🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4624

Re: int's and zero

#4624
From: Clive D.W. Feather
Date: Fri, 12 Jan 1996 18:35
23 lines
1518 bytes
In article <DL0CII.F9A@ukpsshp1.serigate.philips.nl>,
Stephen Baynes <baynes@ukpsshp1.serigate.philips.nl> wrote:
> Also (under as-if) the bits one sees probably only have to look like binary
> to operations such as & and <<. For example I think it is possible to
> do something like invert the bits as you read/write memory. Consider this
> perverse implementation:
>     char - normal binary encoding
>     int - binary encoding except that bits are inverted when reading/writing
>         memory.
> Thus binary 0000 written as char will look like binary 1111 when read as int.
> So 'memset( &i, 0, sizeof(int) )' will not set int 'i' to 0.

As I interpret the ruling (DR069), this is not permitted.

> P.S. Was there ever a final ruling over whether UINT_MAX had to be of the
> form 2^n-1 ?

Yes, it does.

-- 
Clive D.W. Feather                       | If you lie to the compiler,
clive@demon.net        (work, preferred) | it will get its revenge.
clive@stdc.demon.co.uk (home)            |   - Henry Spencer
Technical Details
Message-ID: <DL2zMG.Dpn@stdc.demon.co.uk>
Path: arc1-ca.pugleaf.net!stdc.demon.co.uk!clive
References: <4cth4e$4q@odin.funcom.no> <4cub1a$jbl@alterdial.UU.NET> <4d0kd3$d8l@sam.inforamp.net> <DL0CII.F9A@ukpsshp1.serigate.philips.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!stdc.demon.co.uk!clive
From: clive@stdc.demon.co.uk (Clive D.W. Feather)
Newsgroups: comp.std.c
Subject: Re: int's and zero
Date: Fri, 12 Jan 1996 18:35:02 GMT
Organization: Demon Internet Limited (personal account)
Message-ID: <DL2zMG.Dpn@stdc.demon.co.uk>
References: <4cth4e$4q@odin.funcom.no> <4cub1a$jbl@alterdial.UU.NET> <4d0kd3$d8l@sam.inforamp.net> <DL0CII.F9A@ukpsshp1.serigate.philips.nl>
Reply-To: clive@demon.net
X-NNTP-Posting-Host: stdc.demon.co.uk