Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVL4I-0000zb-0c for pgsql-committers@arkaria.postgresql.org; Tue, 19 Jun 2018 18:09:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVL4F-0000qr-Tc for pgsql-committers@arkaria.postgresql.org; Tue, 19 Jun 2018 18:09:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVL4F-0000qi-OX for pgsql-committers@lists.postgresql.org; Tue, 19 Jun 2018 18:09:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVL49-0000y9-0l for pgsql-committers@lists.postgresql.org; Tue, 19 Jun 2018 18:09:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w5JI9FR8001905; Tue, 19 Jun 2018 14:09:15 -0400 From: Tom Lane To: Bruce Momjian cc: Stephen Frost , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix for globals.c- c.h must come first In-reply-to: <20180619175834.GE3637@momjian.us> References: <20180619175834.GE3637@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Tue, 19 Jun 2018 13:58:34 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1903.1529431755.1@sss.pgh.pa.us> Date: Tue, 19 Jun 2018 14:09:15 -0400 Message-ID: <1904.1529431755@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > On Sat, May 19, 2018 at 01:20:47AM +0000, Stephen Frost wrote: >> Commit da9b580 mistakenly put a system header before postgres.h (which >> includes c.h). That can cause portability issues and broke (at least) >> builds with older Windows compilers. > I assume there is no way to add defined and checks to globals.c and c.h > to cause a compile error when this happens. Hm. You could imagine adding something like #ifdef some-relevant-macro #error include ordering problem, c.h must come before system headers #endif near the head of c.h. But I'm not sure how we'd get full coverage. The case presumably would only occur for off-the-beaten-path headers (this particular mistake was ), and there are lots of those. regards, tom lane