Re: compile warnings in CVS HEAD?

From: Kurt Roeckx <Q(at)ping(dot)be>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: compile warnings in CVS HEAD?
Date: 2003-09-04 17:14:08
Message-ID: 20030904171408.GA14879@ping.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-09-04 17:18:57 Re: TCP/IP with 7.4 beta2 broken?
Previous Message Adam Kavan 2003-09-04 16:21:48 Re: Stats Collector Error 7.4beta1 and 7.4beta2