Skip to content

Commit 894be78

Browse files
committed
gcc_builtin/atomic: Silence numerous warnings from Studio compilers
This commit adds selective use of a compiler-specific pragma to silence the numerous warnings the Sun/Oracle/Studio compilers emit for the GNU-style inline asm used in atomic.h. Thanks Paul Hargrove for the initial patch and the guidance.
1 parent 7b39d90 commit 894be78

File tree

1 file changed

+14
-0
lines changed
  • opal/include/opal/sys/gcc_builtin

1 file changed

+14
-0
lines changed

opal/include/opal/sys/gcc_builtin/atomic.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
1414
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
1515
* reserved.
16+
* Copyright (c) 2016 Research Organization for Information Science
17+
* and Technology (RIST). All rights reserved.
1618
* $COPYRIGHT$
1719
*
1820
* Additional copyrights may follow
@@ -67,6 +69,14 @@ static inline void opal_atomic_wmb(void)
6769
*
6870
*********************************************************************/
6971

72+
/*
73+
* Suppress numerous (spurious ?) warnings from Oracle Studio compilers
74+
* see https://community.oracle.com/thread/3968347
75+
*/
76+
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
77+
#pragma error_messages(off, E_ARG_INCOMPATIBLE_WITH_ARG_L)
78+
#endif
79+
7080
static inline int opal_atomic_cmpset_acq_32( volatile int32_t *addr,
7181
int32_t oldval, int32_t newval)
7282
{
@@ -211,4 +221,8 @@ static inline void opal_atomic_unlock (opal_atomic_lock_t *lock)
211221

212222
#endif
213223

224+
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
225+
#pragma error_messages(default, E_ARG_INCOMPATIBLE_WITH_ARG_L)
226+
#endif
227+
214228
#endif /* ! OPAL_SYS_ARCH_ATOMIC_H */

0 commit comments

Comments
 (0)