Re: PATCH: bonobo-activation core dump on Solaris



On 11/30/01 11:27 AM, "Laszlo PETER" <Laszlo Peter ireland sun com> wrote:

> The initialisation below is not valid using the Forte C compiler. The
> structure remains uninitialised and causes bonobo-activation to core dump.

This is going to be a non-trivial problem. The C-standard-required behavior,
where structure fields get zeroed out if they aren't mentioned, is something
we rely on in a number of other places in Gnome.

The wording from the C standard is this, "If there are fewer initializers in
a brace-enclosed list than there are elements or members of an aggregate, or
fewer characters in a string literal used to initialize an array of known
size than there are elements in the array, the remainder of the aggregate
shall be initialized implicitly the same as objects that have static storage
duration."

And "same as objects that have static storage duration" essentially means
"zero everything out".

I'm not sure how many places in Gnome this comes up, but I know that I've
relied on this behavior more than 20 times since I've worked on Gnome.

    -- Darin




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