Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1epInI-0003RE-DT for pgsql-general@arkaria.postgresql.org; Fri, 23 Feb 2018 19:14:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epInH-0003ta-7v for pgsql-general@arkaria.postgresql.org; Fri, 23 Feb 2018 19:14:07 +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.84_2) (envelope-from ) id 1epIjG-0001eS-IC for pgsql-general@lists.postgresql.org; Fri, 23 Feb 2018 19:09:58 +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 1epIjD-0000xH-GQ for pgsql-general@lists.postgresql.org; Fri, 23 Feb 2018 19:09:57 +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 w1NJ9ivm015099; Fri, 23 Feb 2018 14:09:45 -0500 From: Tom Lane To: Demitri Muna cc: pgsql-general@lists.postgresql.org Subject: Re: Location to specify C compiler option in C extension In-reply-to: <5186A762-290F-42CC-851E-E9D873CE51B0@demitri.com> References: <5186A762-290F-42CC-851E-E9D873CE51B0@demitri.com> Comments: In-reply-to Demitri Muna message dated "Fri, 23 Feb 2018 13:35:31 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <15097.1519412984.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Feb 2018 14:09:44 -0500 Message-ID: <15098.1519412984@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Demitri Muna writes: > I=E2=80=99m writing a C extension and have successfully based my Makefil= e on existing templates. This conveniently hides the details of the full M= akefile provided by "pg_config --pgxs=E2=80=9D. Which variable would be th= e appropriate one to specify the =E2=80=98-std=3Dc99=E2=80=99 compiler fla= g? I=E2=80=99ve tried many and still get warnings that this flag should su= ppress (specifically, "ISO C90 forbids mixed declarations and code=E2=80=9D= ). These are the variables I currently define: PG_CPPFLAGS ought to work. One point is that you need to set that before including pgxs.mk; maybe it's an ordering problem? regards, tom lane