Re: compile warnings in CVS HEAD? - Mailing list pgsql-hackers

From Kurt Roeckx
Subject Re: compile warnings in CVS HEAD?
Date
Msg-id 20030904171408.GA14879@ping.be
Whole thread Raw
In response to Re: compile warnings in CVS HEAD?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: compile warnings in CVS HEAD?  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
On Wed, Sep 03, 2003 at 10:30:05PM -0400, Tom Lane wrote:
> 
> > tablecmds.c: In function `validateForeignKeyConstraint':
> > tablecmds.c:3546: warning: dereferencing type-punned pointer will break
> > strict-aliasing rules
> 
> Hm.  Got any idea what these are really complaining about?  I see no
> such gripes with the gcc versions I use, but I wouldn't be surprised
> if gcc 3.3 is trying to tighten up.

It's about optimisation.

The compiler is free to assume that 2 pointers of a different
type never point to the same variable.

It basicly happens when you cast a pointer of 1 type to an other.

See the gcc info page for a little more information.

The recommended way to deal with is to put them into a union.


Kurt



pgsql-hackers by date:

Previous
From: Adam Kavan
Date:
Subject: Re: Stats Collector Error 7.4beta1 and 7.4beta2
Next
From: Peter Eisentraut
Date:
Subject: Re: TCP/IP with 7.4 beta2 broken?