cpluspluscheck complains about use of register

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: cpluspluscheck complains about use of register
Date: 2022-03-08 18:18:37
Message-ID: 20220308181837.aun3tdtdvao4vb7o@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

When running cpluspluscheck I get many many complaints like

In file included from /tmp/pg-test-repo/src/include/port/atomics.h:70,
from /tmp/pg-test-repo/src/include/utils/dsa.h:17,
from /tmp/pg-test-repo/src/include/nodes/tidbitmap.h:26,
from /tmp/pg-test-repo/src/include/nodes/execnodes.h:24,
from /tmp/pg-test-repo/src/include/commands/trigger.h:17,
from /tmp/pg-test-repo/src/pl/plpgsql/src/plpgsql.h:21,
from /tmp/cpluspluscheck.qOi18T/test.cpp:3:
/tmp/pg-test-repo/src/include/port/atomics/arch-x86.h: In function ‘bool pg_atomic_test_set_flag_impl(volatile pg_atomic_flag*)’:
/tmp/pg-test-repo/src/include/port/atomics/arch-x86.h:143:23: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
143 | register char _res = 1;
| ^~~~

It seems we should just remove the use of register? It's currently only used
in
src/include/storage/s_lock.h
src/include/port/atomics/arch-x86.h

From what I understand compilers essentially have been ignoring it for quite a
while...

Greetings,

Andres Freund

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-03-08 18:29:06 Re: logical decoding and replication of sequences
Previous Message Robert Haas 2022-03-08 17:19:34 Re: New developer papercut - Makefile references INSTALL