lilypond-devel
[Top][All Lists]
Advanced

[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 09:48:18 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Aug 17, 2011 at 05:53:40AM -0600, Carl Sorensen wrote:
> \On 8/16/11 10:25 PM, "Dan Eble" <address@hidden> wrote:
> 
> > Is there a reason that these variables in lily/profile.cc don't need to be
> > initialized?  I don't have experience with guile, but it looks dangerous.
> 
> I guess the code in this section relies on the fact that the compiler will
> initialize the unitialized value to zero.   Do you believe that is a
> problem?

Is there a special rule that compilers will always initalize
uninitialized scheme values to zero?  Because I discovered a
segfault just yesterday (in a different program) that was because
of gcc [1] not initalizing a variable to 0.

[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.

Cheers,
- Graham



reply via email to

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