cpluspluscheck complains about use of register - Mailing list pgsql-hackers

From Andres Freund
Subject cpluspluscheck complains about use of register
Date
Msg-id 20220308181837.aun3tdtdvao4vb7o@alap3.anarazel.de
Whole thread Raw
Responses Re: cpluspluscheck complains about use of register  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
classspecifier [-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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: New developer papercut - Makefile references INSTALL
Next
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences