Re: PG compilation error with Visual Studio 2015/2017/2019 - Mailing list pgsql-hackers

From Juan José Santamaría Flecha
Subject Re: PG compilation error with Visual Studio 2015/2017/2019
Date
Msg-id CAC+AXB1OjP+UHcG4C0v6T2QOPvD+cHKfiQNSY5YWNU8uhYP0Zg@mail.gmail.com
Whole thread Raw
In response to Re: PG compilation error with Visual Studio 2015/2017/2019  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers

On Tue, Apr 21, 2020 at 2:22 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
More few comments.

1. Comments about order:
/*
 * Callback function for EnumSystemLocalesEx.
 * Stop enumerating if a match is found for a locale with the format
 * <Language>_<Country>.
 * The order for search locale is essential:
 * Find LCType first as LOCALE_SNAME, if not found try LOCALE_SENGLISHLANGUAGENAME and
 * finally LOCALE_SENGLISHCOUNTRYNAME, before return.
 */
 
Typo "enumarating".

I would not call the order essential, is just meant to try the easier ways first: is already "ISO" formatted !-> is just a "language" !-> is a full "language_country" tag.

I take note about  "enumarating".

2. Maybe the fail has here:

if (hyphen == NULL || underscore == NULL)

Change || to &&, the logical is wrong?

If the Windows locale does not have a hyphen ("aa") *or*  the lc_message does not have an underscore ("Afar"), only a comparison on language is needed.

3. Why iso_lc_messages[0] = '\0'?

If we go call strchr, soon after, it's a waste.

Less code churn, and  strchr() againts an empty string did not look too awful.

I would like to find were the errors come from before sending a new version, can you reproduce them?

Regards,

Juan José Santamaría Flecha
 

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Concurrency bug in amcheck
Next
From: Fujii Masao
Date:
Subject: Re: Remove non-fast promotion Re: Should we remove a fallbackpromotion? take 2