Remove pg_strtouint64(), use strtoull() directly

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Remove pg_strtouint64(), use strtoull() directly
Date: 2021-12-10 07:06:14
Message-ID: a3df47c9-b1b4-29f2-7e91-427baf8b75a3@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pg_strtouint64() is a wrapper around strtoull/strtoul/_strtoui64, but it
seems no longer necessary to have this indirection.

msvc/Solution.pm claims HAVE_STRTOULL, so the "MSVC only" part seems
unnecessary. Also, we have code in c.h to substitute alternatives for
strtoull() if not found, and that would appear to cover all currently
supported platforms, so having a further fallback in pg_strtouint64()
seems unnecessary.

(AFAICT, the only buildfarm member that does not have strtoull()
directly but relies on the code in c.h is gaur. So we can hang on to
that code for a while longer, but its utility is also fading away.)

Therefore, remove pg_strtouint64(), and use strtoull() directly in all
call sites.

(This is also useful because we have pg_strtointNN() functions that have
a different API than this pg_strtouintNN(). So removing the latter
makes this problem go away.)

Attachment Content-Type Size
0001-Remove-pg_strtouint64-use-strtoull-directly.patch text/plain 4.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message kuroda.hayato@fujitsu.com 2021-12-10 07:35:04 RE: Allow escape in application_name
Previous Message Masahiko Sawada 2021-12-10 05:44:16 Re: Skipping logical replication transactions on subscriber side