From 6cfd5086e140b365086d61f25c519d046dfcf7f0 Mon Sep 17 00:00:00 2001 From: Andres Freund <andres@anarazel.de> Date: Thu, 15 Jan 2015 13:10:24 +0100 Subject: [PATCH] Blindly try to fix a warning in s_lock.h when compiling with gcc on HPPA. The possibly, depending on compiler settings, generated warning was "warning: `S_UNLOCK' redefined". The hppa spinlock implementation doesn't follow the rules of s_lock.h and provides a gcc specific implementation outside of the the part of the file that's supposed to do that. It does so to avoid duplication between the HP compiler and gcc. That unfortunately means that S_UNLOCK is already defined when the HPPA specific section is reached. Undefine the generic fallback S_UNLOCK definition inside the HPPA section. That's far from pretty, but has the big advantage of being simple. If somebody is interested to fix this in a prettier way... This presumably got broken in the course of 0709b7ee72. Discussion: 20150114225919.GY5245@awork2.anarazel.de Per complaint from Tom Lane. --- src/include/storage/s_lock.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 3593b63afc5..52b86e3f0d7 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -752,6 +752,15 @@ tas(volatile slock_t *lock) return (lockval == 0); } +/* + * The hppa implementation doesn't follow the rules of this files and provides + * a gcc specific implementation outside of the above defined(__GNUC__). It + * does so to avoid duplication between the HP compiler and gcc. So undefine + * the generic fallback S_UNLOCK from above. + */ +#ifdef S_UNLOCK +#undef S_UNLOCK +#endif #define S_UNLOCK(lock) \ do { \ __asm__ __volatile__("" : : : "memory"); \ -- GitLab