Skip to content

Commit

Permalink
fix anon-struct usage that's a warning/error -Wnon-c-typedef-for-link…
Browse files Browse the repository at this point in the history
…age (#76610)

Summary:
X-link: pytorch/pytorch#76610

Pull Request resolved: #328

X-link: facebookarchive/fbzmq#38

X-link: facebook/CacheLib#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
  • Loading branch information
luciang authored and facebook-github-bot committed Apr 30, 2022
1 parent 4ed682c commit 7519f32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gloo/broadcast_one_to_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<transport::Buffer> clearToSendBuffer;
std::unique_ptr<transport::Buffer> sendBuffer;
Expand All @@ -127,7 +127,7 @@ class BroadcastOneToAll : public Algorithm {
std::vector<std::unique_ptr<forSender>> sender_;

// For all receivers
using forReceiver = struct {
struct forReceiver {
int dummy;
std::unique_ptr<transport::Buffer> clearToSendBuffer;
std::unique_ptr<transport::Buffer> recvBuffer;
Expand Down
4 changes: 2 additions & 2 deletions gloo/cuda_broadcast_one_to_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<transport::Buffer> clearToSendBuffer;
std::unique_ptr<transport::Buffer> sendBuffer;
Expand All @@ -61,7 +61,7 @@ class CudaBroadcastOneToAll : public Algorithm {
std::vector<std::unique_ptr<forSender>> sender_;

// For all receivers
using forReceiver = struct {
struct forReceiver {
int dummy;
std::unique_ptr<transport::Buffer> clearToSendBuffer;
std::unique_ptr<transport::Buffer> recvBuffer;
Expand Down

0 comments on commit 7519f32

Please sign in to comment.