cpluspluscheck complains about use of register

Поиск
Список
Период
Сортировка
От Andres Freund
Тема cpluspluscheck complains about use of register
Дата
Msg-id 20220308181837.aun3tdtdvao4vb7o@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: cpluspluscheck complains about use of register  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: New developer papercut - Makefile references INSTALL
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: logical decoding and replication of sequences