pgsql: Suppress compiler warnings in ecpg test on newer Windows toolcha

Started by Tom Laneover 9 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Suppress compiler warnings in ecpg test on newer Windows toolchains.

nan_test.pgc supposed that it could unconditionally #define isnan()
and isinf() on WIN32. This was evidently copied at some point from
src/include/port/win32.h, but nowadays there's a test on _MSC_VER
there. Make nan_test.pgc look the same.

Per buildfarm warnings. There's no evidence this produces anything
worse than a warning, and besides it's only a test case, so I don't
feel a need to back-patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c5658a0764d5ac5ea8c2c11d27c62d5472234227

Modified Files
--------------
.../ecpg/test/expected/pgtypeslib-nan_test.c | 102 +++---
.../ecpg/test/expected/pgtypeslib-nan_test.stderr | 354 ++++++++++-----------
src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc | 2 +
3 files changed, 231 insertions(+), 227 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#1)
Re: pgsql: Suppress compiler warnings in ecpg test on newer Windows toolcha

On 25 February 2017 at 10:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Suppress compiler warnings in ecpg test on newer Windows toolchains.

nan_test.pgc supposed that it could unconditionally #define isnan()
and isinf() on WIN32. This was evidently copied at some point from
src/include/port/win32.h, but nowadays there's a test on _MSC_VER
there. Make nan_test.pgc look the same.

Per buildfarm warnings. There's no evidence this produces anything
worse than a warning, and besides it's only a test case, so I don't
feel a need to back-patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c5658a0764d5ac5ea8c2c11d27c62d5472234227

Modified Files
--------------
.../ecpg/test/expected/pgtypeslib-nan_test.c | 102 +++---
.../ecpg/test/expected/pgtypeslib-nan_test.stderr | 354 ++++++++++-----------
src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc | 2 +
3 files changed, 231 insertions(+), 227 deletions(-)

This seems to have caused some new compiler warnings [1]https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=thrips&amp;dt=2017-03-07%2022%3A37%3A28&amp;stg=make on earlier
MSVC toolchains.

The reason seems to be that these older versions require float.h to be
included for _isnan() [2]https://msdn.microsoft.com/en-us/library/tzthab44(v=vs.110).aspx

So anyway, we seem to be including float.h in all the other places
we're using isnan(), so the attached adds float.h to the files where
we're getting the warnings too.

[1]: https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=thrips&amp;dt=2017-03-07%2022%3A37%3A28&amp;stg=make
[2]: https://msdn.microsoft.com/en-us/library/tzthab44(v=vs.110).aspx

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

isnan_msvc_warning_fixes.patchapplication/octet-stream; name=isnan_msvc_warning_fixes.patchDownload+4-0
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#2)
Re: pgsql: Suppress compiler warnings in ecpg test on newer Windows toolcha

David Rowley <david.rowley@2ndquadrant.com> writes:

On 25 February 2017 at 10:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Suppress compiler warnings in ecpg test on newer Windows toolchains.

This seems to have caused some new compiler warnings [1] on earlier
MSVC toolchains.

That didn't make any sense to me, because the commit you mention only
touched one ecpg test file. But closer inspection of thrips' buildfarm
history says that the warnings appeared with commit c29aff959, which
does make sense, because that removed <float.h> from a header file that
these .c files must have been getting it from.

Fix pushed, thanks for noticing.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers