Re: Thou shalt have no other gods before the ANSI C standard

From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 15:10:24 GMT


"John E. Hadstate" wrote:
> "CBFalconer" <cbfalconer@yahoo.com> wrote in message
>
... snip ...
>
>> Think trap values.
>> For example, all we have to do is give up one negative value,
>> and we can dynamically detect use of uninitialized variables.
>
> Yes, but which one shall we designate for that purpose?
> 0x80000000? Nope, I like that for a lot of things.
> 0xFFFFFFFF? I don't think so. 0xCCCCCCCC? Well, that's nice
> until my random number generator counts to that state.

Has to be 0x80...0. A continuous set of negative integers from -1
down is required. Assuming 2's complement, else the optimum choice
would be 0..0 for 1's complement, with all 1s representing 0 and
arithmetic done with a subtractor.

>
>> Another high reliability configuration on a 32 bit physical word
>> would be a 26 bit integer, with a trap uninitialized value, and 6
>> bits ecc syndrome. I think that works. Note that, with an 8 bit
>> byte, sizeof(int) would still be 4.
>
> For such a monstrosity, I would expect the C compiler to
> generate code for 26-bit arithmetic and use a 13-bit char.
> I would expect sizeof(int) to be 2.

Won't work, because of the requirement to expose all bits via
unsigned chars. This also makes ints a suitable and reliable
repository for Unicode chars.

Please fix (or replace) your alleged newsreader so that it doesn't
rewrap everything it misquotes. It is a pain to have to go through
the quotations and fix the harm.

-- 
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 "show options" at the top of the article, then click on the 
 "Reply" at the bottom of the article headers." - Keith Thompson


Relevant Pages

  • Re: Changing photos to jpeg format
    ... I noticed the big disclaimer at the bottom that one had to use IE to view ... You can fix the pages so that the links also work in other ... Safari and most other browsers. ... you need to ungroup it from the wizard. ...
    (microsoft.public.publisher.webdesign)
  • Re: Can I fix it and how much?
    ... >trouble is that the crack on the screen stems from the ... >middle of the very bottom of the screen and extends about ... >My question is: Can I fix it? ... >incredible shame to waste a $200+ Pocket PC that I ...
    (microsoft.public.pocketpc)
  • Re: Page Numbers cut off
    ... If I ask for the page number to be on the bottom, ... > different printer driver with a different printable area when printing. ... If I change the printer driver, it ought to either tell me what ... Fix manually would open the appropriate preference ...
    (microsoft.public.mac.office.word)
  • Re: IE 6 not working properly
    ... > figure out how to fix it. ... It is XP home SP2 with all of the updates. ... > it shows is a gray area at the top, a gray areas on the left, an ... > green areas at the bottom, and the "kids privacy" at the bottom. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: [releng_6 tinderbox] failure on sparc64/sparc64
    ... Bruce Evans writes: ... :> It won't matter given how I'm going to fix this problem... ... Why not just access the object as an array of unsigned chars as someone ...
    (freebsd-arch)