Re: Large C files

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Jan Urbański <wulczer(at)wulczer(dot)org>
Subject: Re: Large C files
Date: 2011-09-07 00:18:05
Message-ID: 201109070018.p870I6U10619@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Geoghegan wrote:
> On 7 September 2011 00:13, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> > * Within TUs, we unshadow a previously shadowed variable, so we link
> > to a global variable rather than one local to the original/other new
> > file. Unlikely to be a problem. Here's what I get when I compile
> > xlog.c in the usual way with the addition of the -Wshadow flag:
>
> I hit send too soon. Of course, this isn't going to matter in the case
> I described because an extern declaration of int foo cannot appear in
> the same TU as a static declaration of int foo - it won't compile. I
> hastily gave that as an example of a general phenomenon that can occur
> when performing this splitting process. An actually valid example of
> same would be if someone refactored functions a bit as part of this
> process to make things more modular, and now referenced a global
> variable rather than a local one as part of that process. This is
> quite possible, because namespace pollution is a big problem with
> heavyweight C files - Just look at how much output that -Wshadow flag
> gives when used on xlog.c.

I am confused how moving a function from one C file to another could
cause breakage?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2011-09-07 01:14:18 Re: Large C files
Previous Message Peter Geoghegan 2011-09-07 00:03:55 Re: Large C files