Skip to content

Commit bf3dcb9

Browse files
luciangpytorchmergebot
authored andcommitted
fix anon-struct usage that's a warning/error -Wnon-c-typedef-for-linkage (pytorch#137)
Summary: 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] Test Plan: ```name=before buck-out/v2/gen/fbcode/d839c731f5505c62/datasec/messaging/auth/utils/__MessagingAuthUtils__/headers/datasec/messaging/auth/utils/MessagingAuthLogger.h:83:25: 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] using LogInfo = struct { ``` CI Reviewed By: philippv Differential Revision: D36043476 Pull Request resolved: pytorch#76610 Approved by: https://github.com/philippv, https://github.com/osalpekar
1 parent b6bc5b3 commit bf3dcb9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

caffe2/contrib/shm_mutex/shm_mutex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ShmProcessMutexCheck {
5858
template <class Derived>
5959
struct shm_traits;
6060

61-
using ShmBaseHeader = struct {
61+
struct ShmBaseHeader {
6262
std::atomic<bool> isInitialized;
6363
std::atomic<int> countMapped;
6464
std::atomic<pid_t> owner;

caffe2/image/image_input_op.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ImageInputOp final : public PrefetchOperator<Context> {
6262
bool CopyPrefetched() override;
6363

6464
private:
65-
using BoundingBox = struct {
65+
struct BoundingBox {
6666
bool valid;
6767
int ymin;
6868
int xmin;
@@ -73,7 +73,7 @@ class ImageInputOp final : public PrefetchOperator<Context> {
7373
// Structure to store per-image information
7474
// This can be modified by the DecodeAnd* so needs
7575
// to be privatized per launch.
76-
using PerImageArg = struct { BoundingBox bounding_params; };
76+
struct PerImageArg { BoundingBox bounding_params; };
7777

7878
bool GetImageAndLabelAndInfoFromDBValue(
7979
const string& value,

0 commit comments

Comments
 (0)