Skip to content

Commit 9c6d511

Browse files
yfeldblumfacebook-github-bot
authored andcommitted
avoid warning attributes on mixing inline and noinline in MicroLock
Summary: ``` In file included from folly/MicroLock.cpp:17: folly/MicroLock.h:211:45: error: inline declaration of 'void folly::MicroLockCore::store(uint8_t, std::memory_order)' follows declaration with attribute 'noinline' [-Werror=attributes] 211 | uint8_t value, std::memory_order order) noexcept { | ^~~~~~~~ folly/MicroLock.h:175:33: note: previous declaration of 'void folly::MicroLockCore::store(uint8_t, std::memory_order)' here 175 | FOLLY_DISABLE_SANITIZERS void store( | ^~~~~ ``` Reviewed By: dmm-fb Differential Revision: D72512858 fbshipit-source-id: 629dc9e9b3b1d6593b0a2453ce66a9ef6f93664a
1 parent b26ffd9 commit 9c6d511

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

folly/MicroLock.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <cstdint>
2222
#include <utility>
2323

24+
#include <folly/CPortability.h>
2425
#include <folly/Optional.h>
2526
#include <folly/Portability.h>
2627
#include <folly/detail/Futex.h>
@@ -207,6 +208,8 @@ inline unsigned MicroLockCore::waitBit() const noexcept {
207208
return 1U << (baseShift() + 1);
208209
}
209210

211+
FOLLY_PUSH_WARNING
212+
FOLLY_GCC_DISABLE_WARNING("-Wattributes") // inline + [[gnu::noinline]]
210213
inline void MicroLockCore::store(
211214
uint8_t value, std::memory_order order) noexcept {
212215
detail::Futex<>* wordPtr = word();
@@ -221,6 +224,7 @@ inline void MicroLockCore::store(
221224
}
222225
}
223226
}
227+
FOLLY_POP_WARNING
224228

225229
template <typename Func>
226230
void MicroLockCore::unlockAndStoreWithModifier(Func modifier) noexcept {

0 commit comments

Comments
 (0)