Thread: pgsql: Remove some code for old unsupported versions of MSVC

pgsql: Remove some code for old unsupported versions of MSVC

From
Peter Eisentraut
Date:
Remove some code for old unsupported versions of MSVC

As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013,
which means _MSC_VER >= 1800.  This means that conditionals about
older versions of _MSC_VER can be removed or simplified.

Previous code was also in some cases handling MinGW, where _MSC_VER is
not defined at all, incorrectly, such as in pg_ctl.c and win32_port.h,
leading to some compiler warnings.  This should now be handled better.

Reviewed-by: Michael Paquier <michael@paquier.xyz>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38d8dce61fff09daae0edb6bcdd42b0c7f10ebcd

Modified Files
--------------
src/backend/utils/adt/pg_locale.c                  |  23 +-
src/backend/utils/adt/selfuncs.c                   |  13 -
src/bin/pg_ctl/pg_ctl.c                            |  31 --
src/include/pg_config.h.win32                      |  33 +-
src/include/port/win32.h                           |   2 +-
src/include/port/win32_port.h                      |  12 -
src/include/utils/float.h                          |   4 +-
.../ecpg/test/expected/pgtypeslib-nan_test.c       | 107 +++----
.../ecpg/test/expected/pgtypeslib-nan_test.stderr  | 354 ++++++++++-----------
src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc   |   7 -
src/port/chklocale.c                               |   4 +-
src/tools/msvc/Solution.pm                         |   2 -
12 files changed, 235 insertions(+), 357 deletions(-)


Re: pgsql: Remove some code for old unsupported versions of MSVC

From
Amit Kapila
Date:
On Tue, Oct 8, 2019 at 2:23 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> Remove some code for old unsupported versions of MSVC
>
> As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013,
> which means _MSC_VER >= 1800.  This means that conditionals about
> older versions of _MSC_VER can be removed or simplified.
>

I wonder why this has not been backpatched to v12?  I am talking
mainly about changes in IsoLocaleName made by this function.  The
reason why I started looking at this commit is that I wanted to
backpatch some fix [1] in function IsoLocaleName and it seems to be
different in 12 and 13 for no reason.  It is not a big deal but I was
curious to know if there is a reason we can't have this part of code
the same in 12 and 13.  That will at least allow easier backpatch in
the future.  I understand it is not a part of code that is changed on
a regular basis but still, it might be good to keep the code
consistent.

[1] - https://www.postgresql.org/message-id/CAHzhFSFoJEWezR96um4-rg5W6m2Rj9Ud2CNZvV4NWc9tXV7aXQ%40mail.gmail.com

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



Re: pgsql: Remove some code for old unsupported versions of MSVC

From
Peter Eisentraut
Date:
On 2020-04-29 09:05, Amit Kapila wrote:
> On Tue, Oct 8, 2019 at 2:23 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>>
>> Remove some code for old unsupported versions of MSVC
>>
>> As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013,
>> which means _MSC_VER >= 1800.  This means that conditionals about
>> older versions of _MSC_VER can be removed or simplified.
>>
> 
> I wonder why this has not been backpatched to v12?

It's not a bug fix, so I didn't even consider it.

Also, this patch was part of a series of changes and cleanups in the 
Windows builds, so I wouldn't even know offhand whether backpatching it 
by itself would result in a clean state.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: pgsql: Remove some code for old unsupported versions of MSVC

From
Amit Kapila
Date:
On Wed, Apr 29, 2020 at 3:19 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
>
> On 2020-04-29 09:05, Amit Kapila wrote:
> > On Tue, Oct 8, 2019 at 2:23 PM Peter Eisentraut <peter@eisentraut.org> wrote:
> >>
> >> Remove some code for old unsupported versions of MSVC
> >>
> >> As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013,
> >> which means _MSC_VER >= 1800.  This means that conditionals about
> >> older versions of _MSC_VER can be removed or simplified.
> >>
> >
> > I wonder why this has not been backpatched to v12?
>
> It's not a bug fix, so I didn't even consider it.
>

Okay.

> Also, this patch was part of a series of changes and cleanups in the
> Windows builds, so I wouldn't even know offhand whether backpatching it
> by itself would result in a clean state.
>

This was a good patch and has made code much simpler.  It makes
changes to IsoLocaleName a lot easier.  I was thinking about whether
to make the changes in IsoLocaleName as part of this commit in v12 as
well.  We can't backpatch it in 11 or previous versions as the commit
(d9dd406fe281d22d5238d3c26a7182543c711e74) which made MSVC 2013 as a
minimum requirement is in v12.  As mentioned in my previous email,
this can help to fix another bug but we can leave it as well because
anyway for prior versions (versions < 12) we anyway need to prepare a
separate patch which can be used in v12 as well.

-
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com