Python Front-end to GCC

Dan Sommers dan at tombstonezero.net
Fri Oct 25 08:55:22 EDT 2013


On Fri, 25 Oct 2013 04:55:43 -0700, Mark Janssen wrote:

> On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>> On 22/10/2013 18:37, Oscar Benjamin wrote:

>>> OTOH why in particular would you want to initialise them with zeros?
>>> I often initialise arrays to nan which is useful for debugging.

> Is this some kind of joke?  What has this list become?

We used to initialize RAM to 0xdeadbeef on CPU reset (and sometimes
calls to free in a debugging environment) for the same reason:  if a
program crashesd, and I saw that value in one of the CPU registers, then
I knew that some part of the program accessed "uninitialized" (or freed)
memory.  That pattern also sticks out like a sore thumb (insert your own
C++/hammer joke here) in a core dump.

That said, I seem to recall that somewhere along the way, ANSI C began
to guarantee that certain static (in the technical sense) values were
initialized to 0, or NULL, or something like that, on program startup,
before any user-level code executed.

Dan



More information about the Python-list mailing list