Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Huong Dangminh <huo-dangminh@ys.jp.nec.com>
Cc: Andrew Dunstan <andrew@dunslane.net>,
Jonathan Allen <jallen@americansavingslife.com>,
Andrew Gierth <andrew@tao11.riddles.org.uk>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>,
Michael Meskes <meskes@postgresql.org>,
Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Date: 2018-05-19T16:45:00Z
Lists: pgsql-bugs
Huong Dangminh <huo-dangminh@ys.jp.nec.com> writes: >> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] >> It seems like really we need <ecpg_config.h> in sqltypes.h at least, and >> if we don't want more bugs of the same ilk in future, it'd be wise to stick >> it into something that's included by all ecpg-generated code, like ecpglib.h. >> I am however worried about invasion of client namespace if we do that, so >> not quite sure what to do here. Thoughts? > I am also inclined to the above, by the way. Any other opinions about that? These are the symbols that ecpg_config.h might define, at present: HAVE_INT64 HAVE_LONG_INT_64 HAVE_LONG_LONG_INT HAVE_LONG_LONG_INT_64 ENABLE_THREAD_SAFETY This doesn't seem like a huge invasion of client namespace, but it's not entirely zero risk either. One idea is to leave the back branches as they now stand, but fix this issue in HEAD. That would leave the hazard in sqltypes.h unfixed in the back branches ... but given the lack of field complaints, a fix there could be worse than the disease. > Also thanks for fixing the failed of "Buildfarm member dromedary". > # I also feel curious about it. We still have two issues in the buildfarm: * gaur/pademelon fell over last night for lack of strtoll(). My first response to that was to disable the ecpg tests on those critters, reasoning that it couldn't possibly be worth rolling our own strtoll() in 2018. However, further digging shows that the functionality *is* available, it's just spelled __strtoll. So now I'm inclined to teach configure about that and undo the lobotomization of those animals. If we're still supporting strtoq() we can surely manage __strtoll(). * frogmouth is failing the test too, due to printing values that look like the expected 64-bit result has been truncated to 32 bits. I suspect this explains it: sqlda.pgc: In function 'dump_sqlda': sqlda.pgc:44:4: warning: unknown conversion type character 'l' in format sqlda.pgc:44:4: warning: too many arguments for format I'm guessing that the native printf() on that platform doesn't know "%lld" and is printing the value as 32 bits. This seems a bit problematic to fix. Using INT64_FORMAT isn't a solution: it's a cheat in that it's assuming that "long long" is 64 bits, and what's more, it definitely won't fix the problem on frogmouth because that build is using our own snprintf and so its value of INT64_FORMAT is calibrated to work with our code, ie, it's going to be "%lld" anyway. However ... we've got a ton of other places that use INT64_FORMAT with the native printf, eg in pgbench, and frogmouth is not producing warnings about those usages. So I'm confused about exactly what is happening there. Andrew, do you have any insight? regards, tom lane
Commits
-
Remove configure's check for nonstandard "long long" printf modifiers.
- b929614f5e86 11.0 landed
-
printf("%lf") is not portable, so omit the "l".
- 0aa97b86f902 9.3.24 landed
- fa2cfb962c05 10.5 landed
- e52cabff7054 9.4.19 landed
- c6e846446d17 11.0 landed
- 9c515f77d6cf 9.6.10 landed
- 29a4db65fbb7 9.5.14 landed
-
Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.
- 91f3bcc9e423 9.3.24 landed
- 8109f201da77 9.4.19 landed
- a5be529aaade 10.5 landed
- 7329af6b9ebf 9.5.14 landed
- 22d22e4bddf6 9.6.10 landed
- 06f66cff9e0b 11.0 landed
-
Arrange to supply declarations for strtoll/strtoull if needed.
- e9f475f991fb 9.3.24 landed
- c964c2147136 10.5 landed
- a6228128fc48 11.0 landed
- 95fef6e82a7d 9.5.14 landed
- 4ffd7909c63a 9.6.10 landed
- 023aa76e1952 9.4.19 landed
-
Hot-fix ecpg regression test for missing ecpg_config.h inclusion.
- d73857d5719e 9.3.24 landed
- 54ae787ca732 9.4.19 landed
- bc8656cf980e 9.5.14 landed
- 4ca492425cd9 9.6.10 landed
- e55a5516deee 10.5 landed
- 5e79405d8299 11.0 landed
-
Add some test coverage for ecpg's "long long" support.
- ec99e9aa110a 9.6.10 landed
- e75c832b29b1 9.4.19 landed
- e21085da56a9 10.5 landed
- dbccdd375b41 11.0 landed
- d9cbe9c9fce9 9.3.24 landed
- 9d6616708d3f 9.5.14 landed
-
Recognize that MSVC can support strtoll() and strtoull().
- f586f8638929 11.0 landed
- cf39aebf17c5 10.5 landed
- 63d3e787f954 9.3.24 landed
- 385f4acbf824 9.4.19 landed
- 25caeae8d279 9.6.10 landed
- 11a110595c72 9.5.14 landed
-
Fix up ecpg's configuration so it handles "long long int" in MSVC builds.
- fda3e6578676 10.4 landed
- f171cbe0d90e 9.5.13 landed
- 87b7e1e88772 9.3.23 landed
- 7ee8005ceddf 9.6.9 landed
- 51057feaa6bd 11.0 landed
- 49f9014c8c1e 9.4.18 landed