Re: pgsql: Identity columns

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Identity columns
Date: 2017-04-06 15:19:41
Message-ID: 8ea7e815-956c-33fd-a2fa-f88861e32086@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 4/6/17 10:24, Tom Lane wrote:
> This commit is causing a compiler warning for me:
>
> tablecmds.c: In function 'ATExecSetIdentity':
> tablecmds.c:5936: warning: 'address.objectSubId' may be used uninitialized in this function
> tablecmds.c:5936: warning: 'address.objectId' may be used uninitialized in this function
>
> I'm not sure why it's not complaining about all three fields, because
> AFAICS, the function returns a totally undefined ObjectAddress when
> generatedEl is not set.

Yeah, that was an oversight. It's depressing that not more compilers
warn about an obvious case like this. I have pushed a fix.

> What is the intention there? (If the function
> were adequately documented, maybe I could divine that for myself, but
> heaven help the reader who would like to know what this function is
> supposed to do.)

Added some comments, too.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2017-04-06 15:30:04 pgsql: Comment fixes for extended statistics
Previous Message Peter Eisentraut 2017-04-06 15:18:19 pgsql: Fix compiler warning and add some more comments