aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-09-24 12:01:06 -0700
committerAndres Freund <andres@anarazel.de>2022-09-24 12:08:37 -0700
commit03bf971d2dc701d473705fd00891028d140dd5ae (patch)
tree2bcc69ba7210f9149e653e5ac10cb104fb723c4b /src
parenteef63941c127bcfbc278445b85cf3d9dd9e323b0 (diff)
downloadpostgresql-03bf971d2dc701d473705fd00891028d140dd5ae.tar.gz
postgresql-03bf971d2dc701d473705fd00891028d140dd5ae.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/regex/regexec.c2
-rw-r--r--src/include/port/atomics/arch-x86.h2
-rw-r--r--src/include/storage/s_lock.h14
3 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c
index 29c364f3db1..3d9ff2e6079 100644
--- a/src/backend/regex/regexec.c
+++ b/src/backend/regex/regexec.c
@@ -192,7 +192,7 @@ pg_regexec(regex_t *re,
int flags)
{
struct vars var;
- register struct vars *v = &var;
+ struct vars *v = &var;
int st;
size_t n;
size_t i;
diff --git a/src/include/port/atomics/arch-x86.h b/src/include/port/atomics/arch-x86.h
index cef1ba724c9..6c0b917f12e 100644
--- a/src/include/port/atomics/arch-x86.h
+++ b/src/include/port/atomics/arch-x86.h
@@ -140,7 +140,7 @@ pg_spin_delay_impl(void)
static inline bool
pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr)
{
- register char _res = 1;
+ char _res = 1;
__asm__ __volatile__(
" lock \n"
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 65aa66c5984..4225d9b7fc3 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -142,7 +142,7 @@ typedef unsigned char slock_t;
static __inline__ int
tas(volatile slock_t *lock)
{
- register slock_t _res = 1;
+ slock_t _res = 1;
/*
* Use a non-locking test before asserting the bus lock. Note that the
@@ -223,7 +223,7 @@ typedef unsigned char slock_t;
static __inline__ int
tas(volatile slock_t *lock)
{
- register slock_t _res = 1;
+ slock_t _res = 1;
__asm__ __volatile__(
" lock \n"
@@ -356,7 +356,7 @@ typedef unsigned char slock_t;
static __inline__ int
tas(volatile slock_t *lock)
{
- register slock_t _res;
+ slock_t _res;
/*
* See comment in src/backend/port/tas/sunstudio_sparc.s for why this
@@ -511,9 +511,9 @@ typedef unsigned int slock_t;
static __inline__ int
tas(volatile slock_t *lock)
{
- register volatile slock_t *_l = lock;
- register int _res;
- register int _tmp;
+ volatile slock_t *_l = lock;
+ int _res;
+ int _tmp;
__asm__ __volatile__(
" .set push \n"
@@ -574,7 +574,7 @@ static __inline__ int
tas(volatile slock_t *lock)
{
volatile int *lockword = TAS_ACTIVE_WORD(lock);
- register int lockval;
+ int lockval;
/*
* The LDCWX instruction atomically clears the target word and