Compile failures today

Started by Bruce Momjianover 7 years ago8 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

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 +
#2Andres Freund
andres@anarazel.de
In reply to: Bruce Momjian (#1)
Re: Compile failures today

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.

In reply to: Andres Freund (#2)
Re: Compile failures today

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

#4Andres Freund
andres@anarazel.de
In reply to: Peter Geoghegan (#3)
Re: Compile failures today

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

#5Bruce Momjian
bruce@momjian.us
In reply to: Andres Freund (#4)
Re: Compile failures today

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 +
#6Andres Freund
andres@anarazel.de
In reply to: Bruce Momjian (#5)
Re: Compile failures today

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

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#6)
Re: Compile failures today

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

#8Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#7)
Re: Compile failures today

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 +