Re: ANSI-strict pointer aliasing rules - Mailing list pgsql-hackers

From Taral
Subject Re: ANSI-strict pointer aliasing rules
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: ANSI-strict pointer aliasing rules  ("Zeugswetter Andreas DCP SD" <[email protected]>)
List pgsql-hackers
On 4/27/06, Zeugswetter Andreas DCP SD <[email protected]> wrote:
> Can you please explain what exactly was not working ?
> xlc has in the past shown warnings that were actually problematic code
> that gcc did not show (and the cc variant of xlc also does not show).

This has nothing to do with warnings. With xlc version 6, this code:

Value *
makeString(char *str)
{Value       *v = makeNode(Value);
v->type = T_String;v->val.str = str;return v;
}

Will return objects whose "type" field is T_Value (650), because the
compiler reorders the assignment that makeNode makes with that of the
main function.

--
Taral <[email protected]>
"You can't prove anything."   -- Gödel's Incompetence Theorem


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: GIN - Generalized Inverted iNdex. Try 3.
Next
From: Taral
Date:
Subject: Re: ANSI-strict pointer aliasing rules