bug in function strtoint, on Windows OS won't report ERANGE - Mailing list pgsql-bugs

From Miron Berlin
Subject bug in function strtoint, on Windows OS won't report ERANGE
Date
Msg-id DM4P223MB0518D09B523522F099A97E2CC0222@DM4P223MB0518.NAMP223.PROD.OUTLOOK.COM
Whole thread Raw
Responses Re: bug in function strtoint, on Windows OS won't report ERANGE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Dear Postgres Dev Team,


Functionstrtoint has a bug. It would not report ERANGE on Windows OS compiled with Microsoft Visual Studio compiler.
To work correctly please replace call to strtol with call to strtoll ( please note two letters l on the right hand side ).
This function should produce correct data type on all available platforms.
In addition, please modify type of the variable val declared at the top of the function from long to an portable 64 bit long integer.
For example long long.

Please note, an substitution of function strtoint with strtol sets errno as expected on Windows platform.
Please note, fixing this bug may have wide impact due to frequent use of function strtoint in various lexer(s).

Thanks,

Miron


pgsql-bugs by date:

Previous
From: Tender Wang
Date:
Subject: Re: BUG #18314: PARALLEL UNSAFE function does not prevent parallel index build
Next
From: jian he
Date:
Subject: Re: BUG #18314: PARALLEL UNSAFE function does not prevent parallel index build