[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uninitialized SCM variables

From: Graham Percival
Subject: Re: Uninitialized SCM variables
Date: Wed, 17 Aug 2011 10:39:27 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Aug 17, 2011 at 07:26:19PM +0200, David Kastrup wrote:
> Graham Percival <address@hidden> writes:
> > [1] or rather, the C standard does not specify that an uninitalized
> > variable should be set to 0, so I do not blame gcc in the least; it
> > was the programmer at fault.
> The C standard guarantees binary zeros for statically allocated
> uninitialized variables.

Ok, in my case it was an uninitalized member variable, on a G5
machine, with something like gcc 4.01 ?  It was dying of memory
when trying to allocated an array of 96x10497652 doubles, because
the programmer forgot to initialize the second variable to 2.

I really dislike languages that allow uninitalized variables; I
dislike dealing with such problems so much that I'm a fan of the
functional "bind a value to a variable and never change it"
approach.  (seen in Mozart/Oz, and probably other languages as
well)  let the compiler optimize for memory reuse and stuff!

- Graham

reply via email to

[Prev in Thread] Current Thread [Next in Thread]