Skip to content

Commit c25414a

Browse files
dbortfacebook-github-bot
authored andcommitted
Work around an old GCC bug in memory_manager.h (#529)
Summary: Pull Request resolved: #529 We were hitting https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 "maybe_unused attribute triggers syntax error when used on first argument to a constructor" when building with older versions of GCC, like v8.5.0 on our devvms. Rather than changing things everywhere by modifying compiler.h to avoid using `[[maybe_unused]]`, patch this one spot. It's deprecated anyway, and should go away soon. ghstack-source-id: 202346140 exported-using-ghexport Reviewed By: digantdesai Differential Revision: D49759354 fbshipit-source-id: 9e912d96f4b162f456ec88daca79a6e5da33af16
1 parent aa82b7d commit c25414a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtime/executor/memory_manager.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ class MemoryManager final {
6363
* TODO(T162089316): Remove this once all users migrate to the new ctor.
6464
*/
6565
__ET_DEPRECATED MemoryManager(
66-
__ET_UNUSED MemoryAllocator* constant_allocator,
66+
// We would normally use __ET_UNUSED here, but GCC older than 9.3 has a
67+
// bug that triggers a syntax error when using [[maybe_unused]] on the
68+
// first parameter of a constructor:
69+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429
70+
__attribute__((unused)) MemoryAllocator* constant_allocator,
6771
HierarchicalAllocator* non_constant_allocator,
6872
MemoryAllocator* runtime_allocator,
6973
MemoryAllocator* kernel_temporary_allocator)

0 commit comments

Comments
 (0)