8000 [codemod] Fix missing field initializer in caffe2/torch/lib/libshm/ma… · pytorch/pytorch@d54cab7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d54cab7

Browse files
r-barnespytorchmergebot
authored andcommitted
[codemod] Fix missing field initializer in caffe2/torch/lib/libshm/manager.cpp +1 (#148393)
Summary: The LLVM warning `-Wmissing-field-initializers` has found one or more structs in this diff's files which were missing field initializers. This can be unintended such as: ``` my_struct s1 = {0}; // Initializes *only* the first field to zero; others to default values my_struct s 8000 2 = {}; // Initializes *all* fields to default values (often zero) ``` or it may be because only some of the members of a struct are initialized, perhaps because the items were added to the struct but not every instance of it was updated. To fix the problem, I've either used `{}` to initialize all fields to default or added appropriate default initializations to the missing fields. - If you approve of this diff, please use the "Accept & Ship" button :-) Test Plan: Sandcastle Reviewed By: dtolnay Differential Revision: D70472663 Pull Request resolved: #148393 Approved by: https://github.com/Skylion007
1 parent 70410f9 commit d54cab7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/lib/libshm/manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ std::unordered_map<int, ClientSession> client_sessions;
3838
std::set<std::string> used_objects;
3939

4040
void register_fd(int fd) {
41-
struct pollfd pfd = {0};
41+
struct pollfd pfd = {};
4242
pfd.fd = fd;
4343
pfd.events = POLLIN;
4444
pollfds.push_back(pfd);

0 commit comments

Comments
 (0)
0