pgsql: Fix incidental warnings from cpluspluscheck.

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

Fix incidental warnings from cpluspluscheck.

Remove use of "register" keyword in hashfn.c. It's obsolescent
according to recent C++ compilers, and no modern C compiler pays
much attention to it either.

Also fix one cosmetic warning about signed vs unsigned comparison.

Discussion: /messages/by-id/20518.1559494394@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/232720be9b6412ec2b6bee405299bcbbbe700f0b

Modified Files
--------------
src/backend/utils/hash/hashfn.c | 16 ++++++++--------
src/include/utils/expandeddatum.h | 2 +-
src/include/utils/hashutils.h | 6 +++---
3 files changed, 12 insertions(+), 12 deletions(-)

#2Thomas Munro
thomas.munro@gmail.com
In reply to: Tom Lane (#1)
Re: pgsql: Fix incidental warnings from cpluspluscheck.

On Mon, Aug 19, 2019 at 11:01 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Remove use of "register" keyword in hashfn.c. It's obsolescent
according to recent C++ compilers, and no modern C compiler pays
much attention to it either.

We have some more of those:

src/backend/regex/regexec.c
src/common/md5.c
src/include/port/atomics/arch-x86.h
src/include/storage/s_lock.h
src/pl/plperl/ppport.h

--
Thomas Munro
https://enterprisedb.com

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Munro (#2)
Re: pgsql: Fix incidental warnings from cpluspluscheck.

Thomas Munro <thomas.munro@gmail.com> writes:

On Mon, Aug 19, 2019 at 11:01 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Remove use of "register" keyword in hashfn.c. It's obsolescent
according to recent C++ compilers, and no modern C compiler pays
much attention to it either.

We have some more of those:

src/backend/regex/regexec.c
src/common/md5.c
src/include/port/atomics/arch-x86.h
src/include/storage/s_lock.h
src/pl/plperl/ppport.h

I was just getting rid of the ones that cpluspluscheck complained
about, which were in function prototypes. I doubt we want to touch
any of the register local variables in s_lock.h or arch-x86.h,
because they're all associated with asm sections that require them
to be registers anyway. And ppport.h is not ours to change.
I have no objection to getting rid of the ones in regexec.c or
md5.c, though.

regards, tom lane