Обсуждение: Compile failures today
I started seeing the following compile failures in head today on current Debian Jessie using the default gcc version 4.9.2 (Debian 4.9.2-10+deb8u1): postgres.c: In function ‘exec_parse_message’: postgres.c:1368:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < numParams; i++) ^ postgres.c:1368:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code postgres.c: In function ‘exec_bind_message’: postgres.c:1558:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < numPFormats; i++) ^ postgres.c:1652:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int paramno = 0; paramno < numParams; paramno++) ^ postgres.c:1781:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < numRFormats; i++) ^ postgres.c: In function ‘errdetail_params’: postgres.c:2217:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int paramno = 0; paramno < params->numParams; paramno++) ^ postgres.c: In function ‘exec_describe_statement_message’: postgres.c:2378:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < psrc->num_params; i++) ^ postgres.c: In function ‘PostgresMain’: postgres.c:4174:7: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < numParams; i++) ^ Is this being worked on? -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +
On August 24, 2018 2:13:24 PM PDT, Bruce Momjian <bruce@momjian.us> wrote: >I started seeing the following compile failures in head today on >current >Debian Jessie using the default gcc version 4.9.2 (Debian >4.9.2-10+deb8u1): > > postgres.c: In function ‘exec_parse_message’: > postgres.c:1368:3: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int i = 0; i < numParams; i++) > ^ > postgres.c:1368:3: note: use option -std=c99, -std=gnu99, -std=c11 or >-std=gnu11 to compile your code > postgres.c: In function ‘exec_bind_message’: > postgres.c:1558:3: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int i = 0; i < numPFormats; i++) > ^ > postgres.c:1652:3: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int paramno = 0; paramno < numParams; paramno++) > ^ > postgres.c:1781:3: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int i = 0; i < numRFormats; i++) > ^ > postgres.c: In function ‘errdetail_params’: > postgres.c:2217:3: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int paramno = 0; paramno < params->numParams; paramno++) > ^ > postgres.c: In function ‘exec_describe_statement_message’: > postgres.c:2378:2: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int i = 0; i < psrc->num_params; i++) > ^ > postgres.c: In function ‘PostgresMain’: > postgres.c:4174:7: error: ‘for’ loop initial declarations are only >allowed in C99 or C11 mode > for (int i = 0; i < numParams; i++) > ^ > >Is this being worked on? Do they persist after you do re-configure? If so, could you send your config.log? Andres -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On Fri, Aug 24, 2018 at 2:15 PM, Andres Freund <andres@anarazel.de> wrote: > Do they persist after you do re-configure? If so, could you send your config.log? I should point out to Bruce that this is clearly related to commit 143290efd0795b61ed2c8358fc1767e799140047. -- Peter Geoghegan
On 2018-08-24 14:35:18 -0700, Peter Geoghegan wrote: > On Fri, Aug 24, 2018 at 2:15 PM, Andres Freund <andres@anarazel.de> wrote: > > Do they persist after you do re-configure? If so, could you send your config.log? > > I should point out to Bruce that this is clearly related to commit > 143290efd0795b61ed2c8358fc1767e799140047. Yes, but the preceding commit (d9dd406fe281d22d5) should've added the -std=gnu99, if required, the message complains about - the fact that it didn't seems to indicate that either configure didn't run (a bit odd, I think it should automatically trigger), or something weird is up (hence config.log). Greetings, Andres Freund
On Fri, Aug 24, 2018 at 02:46:07PM -0700, Andres Freund wrote: > On 2018-08-24 14:35:18 -0700, Peter Geoghegan wrote: > > On Fri, Aug 24, 2018 at 2:15 PM, Andres Freund <andres@anarazel.de> wrote: > > > Do they persist after you do re-configure? If so, could you send your config.log? > > > > I should point out to Bruce that this is clearly related to commit > > 143290efd0795b61ed2c8358fc1767e799140047. > > Yes, but the preceding commit (d9dd406fe281d22d5) should've added the > -std=gnu99, if required, the message complains about - the fact that it > didn't seems to indicate that either configure didn't run (a bit odd, I > think it should automatically trigger), or something weird is up (hence > config.log). Since no one else was seeing this problem, I started digging, and I have found it. I narrowed it to down to this line in Makefile.custom CC=ccache gcc I thought the problem was that ccache was not detecting the configuration change, but in fact I had to manually change this line to: CC=ccache gcc -std=gnu99 so I am good now. :-) (I don't know any way to cleanly add ccache to CC without hard-coding what configure set it to.) -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +
On 2018-08-24 18:21:48 -0400, Bruce Momjian wrote: > On Fri, Aug 24, 2018 at 02:46:07PM -0700, Andres Freund wrote: > > On 2018-08-24 14:35:18 -0700, Peter Geoghegan wrote: > > > On Fri, Aug 24, 2018 at 2:15 PM, Andres Freund <andres@anarazel.de> wrote: > > > > Do they persist after you do re-configure? If so, could you send your config.log? > > > > > > I should point out to Bruce that this is clearly related to commit > > > 143290efd0795b61ed2c8358fc1767e799140047. > > > > Yes, but the preceding commit (d9dd406fe281d22d5) should've added the > > -std=gnu99, if required, the message complains about - the fact that it > > didn't seems to indicate that either configure didn't run (a bit odd, I > > think it should automatically trigger), or something weird is up (hence > > config.log). > > Since no one else was seeing this problem, I started digging, and I have > found it. I narrowed it to down to this line in Makefile.custom > > CC=ccache gcc Yea, that's a bad idea. You should instead pass CC='ccache gcc' to configure, rather than doing it Makefile.custom. Greetings, Andres Freund
Andres Freund <andres@anarazel.de> writes: > On 2018-08-24 18:21:48 -0400, Bruce Momjian wrote: >> Since no one else was seeing this problem, I started digging, and I have >> found it. I narrowed it to down to this line in Makefile.custom >> CC=ccache gcc > Yea, that's a bad idea. You should instead pass CC='ccache gcc' to > configure, rather than doing it Makefile.custom. Indeed. This way is overriding the CC setting configure chose, which means that none of configure's determinations of compiler properties (or much else, perhaps) are really valid. regards, tom lane
On Fri, Aug 24, 2018 at 06:41:07PM -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > On 2018-08-24 18:21:48 -0400, Bruce Momjian wrote: > >> Since no one else was seeing this problem, I started digging, and I have > >> found it. I narrowed it to down to this line in Makefile.custom > >> CC=ccache gcc > > > Yea, that's a bad idea. You should instead pass CC='ccache gcc' to > > configure, rather than doing it Makefile.custom. > > Indeed. This way is overriding the CC setting configure chose, which > means that none of configure's determinations of compiler properties > (or much else, perhaps) are really valid. You are right that "CC='ccache gcc' configure" worked properly. Thanks. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +