Skip to content

Commit 03bf971

Browse files
committed
Remove uses of register due to incompatibility with C++17 and up
The use in regexec.c could remain, since we only try to keep headers C++ clean. But there really doesn't seem to be a good reason to use register in that spot. Discussion: https://postgr.es/m/20220308185902.ibdqmasoaunzjrfc@alap3.anarazel.de
1 parent eef6394 commit 03bf971

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

.cirrus.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,6 @@ task:
556556
# - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
557557
# - XXX have to disable ICU to avoid errors:
558558
# https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
559-
# - XXX: the -Wno-register avoids verbose warnings:
560-
# https://postgr.es/m/20220308181837.aun3tdtdvao4vb7o%40alap3.anarazel.de
561559
###
562560
always:
563561
headers_headerscheck_script: |
@@ -569,7 +567,7 @@ task:
569567
make -s -j${BUILD_JOBS} clean
570568
time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
571569
headers_cpluspluscheck_script: |
572-
time make -s cpluspluscheck EXTRAFLAGS='-Wno-register -fmax-errors=10'
570+
time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
573571
574572
always:
575573
upload_caches: ccache

src/backend/regex/regexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pg_regexec(regex_t *re,
192192
int flags)
193193
{
194194
struct vars var;
195-
register struct vars *v = &var;
195+
struct vars *v = &var;
196196
int st;
197197
size_t n;
198198
size_t i;

src/include/port/atomics/arch-x86.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pg_spin_delay_impl(void)
140140
static inline bool
141141
pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr)
142142
{
143-
register char _res = 1;
143+
char _res = 1;
144144

145145
__asm__ __volatile__(
146146
" lock \n"

src/include/storage/s_lock.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ typedef unsigned char slock_t;
142142
static __inline__ int
143143
tas(volatile slock_t *lock)
144144
{
145-
register slock_t _res = 1;
145+
slock_t _res = 1;
146146

147147
/*
148148
* Use a non-locking test before asserting the bus lock. Note that the
@@ -223,7 +223,7 @@ typedef unsigned char slock_t;
223223
static __inline__ int
224224
tas(volatile slock_t *lock)
225225
{
226-
register slock_t _res = 1;
226+
slock_t _res = 1;
227227

228228
__asm__ __volatile__(
229229
" lock \n"
@@ -356,7 +356,7 @@ typedef unsigned char slock_t;
356356
static __inline__ int
357357
tas(volatile slock_t *lock)
358358
{
359-
register slock_t _res;
359+
slock_t _res;
360360

361361
/*
362362
* See comment in src/backend/port/tas/sunstudio_sparc.s for why this
@@ -511,9 +511,9 @@ typedef unsigned int slock_t;
511511
static __inline__ int
512512
tas(volatile slock_t *lock)
513513
{
514-
register volatile slock_t *_l = lock;
515-
register int _res;
516-
register int _tmp;
514+
volatile slock_t *_l = lock;
515+
int _res;
516+
int _tmp;
517517

518518
__asm__ __volatile__(
519519
" .set push \n"
@@ -574,7 +574,7 @@ static __inline__ int
574574
tas(volatile slock_t *lock)
575575
{
576576
volatile int *lockword = TAS_ACTIVE_WORD(lock);
577-
register int lockval;
577+
int lockval;
578578

579579
/*
580580
* The LDCWX instruction atomically clears the target word and

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy