Skip site navigation (1) Skip section navigation (2)

Re: ANSI-strict pointer aliasing rules

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Taral <taralx(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ANSI-strict pointer aliasing rules
Date: 2006-04-27 17:52:54
Message-ID: 20060427175254.GK29830@svana.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Apr 27, 2006 at 12:21:55PM -0500, Taral wrote:
> > If we do subclassing like this:
> >
> > struct Node { ... };
> > struct Value { struct Node; ... };
> > etc.
> >
> > do we still run into the alias problem?
> 
> Nope, it appears to get rid of the alias problem completely. But it
> requires anonymous structure support (C99?) to work without changing
> anything other than headers.

On that compiler maybe, but what about others? What other problems does
strict-alias cause? Anyway, near as I can tell, anonymous structs are
not in the C standard and I don't think GCC supports them either...

> As a bonus, if we ever change Node, we don't have to update any other
> structures...

Node is unlikely to ever change, it's been like this for at least ten
years...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

pgsql-hackers by date

Next:From: Matthew T. O'ConnorDate: 2006-04-27 18:03:56
Subject: Re: Logging pg_autovacuum
Previous:From: Bruce MomjianDate: 2006-04-27 17:37:55
Subject: Logging pg_autovacuum

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group