Re: memset all bits to zero will let float/double to zero?
From: Richard Bos (rlb_at_hoekstra-uitgeverij.nl)
Date: 06/28/04
- Next message: Martin Ambuhl: "Re: Array managed by preprocessor"
- Previous message: James Hu: "Welcome to comp.lang.c!"
- In reply to: Malcolm: "Re: memset all bits to zero will let float/double to zero?"
- Next in thread: Dan Pop: "Re: memset all bits to zero will let float/double to zero?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Jun 2004 06:11:55 GMT
"Malcolm" <malcolm@55bank.freeserve.co.uk> wrote:
> "Keith Thompson" <kst-u@mib.org> wrote in message
> >
> > For most implementations, null pointers are represented as all-
> > bits-zero, even though using a different representation would
> > only break invalid code. Perhaps that's just inertia.
> >
> I think the main reason is psychological. foo(0) passes a NULL pointer to
> foo(), so an implementor is going to use all bits zero as the representation
> unless there is a really pressing reason to do otherwise.
Huh? Non sequitur, methinks.
> Then there's the
> problem of code that uses memset() or calloc() to intialise pointer data.
The problem is in that code, not in the non-zero representation of a
null pointer where this is useful.
Richard
- Next message: Martin Ambuhl: "Re: Array managed by preprocessor"
- Previous message: James Hu: "Welcome to comp.lang.c!"
- In reply to: Malcolm: "Re: memset all bits to zero will let float/double to zero?"
- Next in thread: Dan Pop: "Re: memset all bits to zero will let float/double to zero?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|