From 7519f328c73368b602b6430cd8b94543f95a997a Mon Sep 17 00:00:00 2001 From: Lucian Grijincu Date: Fri, 29 Apr 2022 20:01:56 -0700 Subject: [PATCH] fix anon-struct usage that's a warning/error -Wnon-c-typedef-for-linkage (#76610) Summary: X-link: https://github.com/pytorch/pytorch/pull/76610 Pull Request resolved: https://github.com/facebookincubator/gloo/pull/328 X-link: https://github.com/facebook/fbzmq/pull/38 X-link: https://github.com/facebook/CacheLib/pull/137 Fix error: anonymous non-C-compatible type given name for linkage purposes by alias declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage] Reviewed By: philippv Differential Revision: D36043476 fbshipit-source-id: 6e1dc16bf1d205bfcf1a359f0e812a9bfdb0d039 --- gloo/broadcast_one_to_all.h | 4 ++-- gloo/cuda_broadcast_one_to_all.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gloo/broadcast_one_to_all.h b/gloo/broadcast_one_to_all.h index 95a3c3f3c..a2d5a0079 100644 --- a/gloo/broadcast_one_to_all.h +++ b/gloo/broadcast_one_to_all.h @@ -118,7 +118,7 @@ class BroadcastOneToAll : public Algorithm { const int rootPointerRank_; // For the sender (root) - using forSender = struct { + struct forSender { int dummy; std::unique_ptr clearToSendBuffer; std::unique_ptr sendBuffer; @@ -127,7 +127,7 @@ class BroadcastOneToAll : public Algorithm { std::vector> sender_; // For all receivers - using forReceiver = struct { + struct forReceiver { int dummy; std::unique_ptr clearToSendBuffer; std::unique_ptr recvBuffer; diff --git a/gloo/cuda_broadcast_one_to_all.h b/gloo/cuda_broadcast_one_to_all.h index ec22558a1..79ca0919e 100644 --- a/gloo/cuda_broadcast_one_to_all.h +++ b/gloo/cuda_broadcast_one_to_all.h @@ -52,7 +52,7 @@ class CudaBroadcastOneToAll : public Algorithm { const bool synchronizeDeviceOutputs_; // For the sender (root) - using forSender = struct { + struct forSender { int dummy; std::unique_ptr clearToSendBuffer; std::unique_ptr sendBuffer; @@ -61,7 +61,7 @@ class CudaBroadcastOneToAll : public Algorithm { std::vector> sender_; // For all receivers - using forReceiver = struct { + struct forReceiver { int dummy; std::unique_ptr clearToSendBuffer; std::unique_ptr recvBuffer;