Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle] fix braced-scalar-init warnings on macos #47309

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ if(APPLE)
CACHE STRING "Build architectures for OSX" FORCE)
endif()
# On Mac OS X register class specifier is deprecated and will cause warning error on latest clang 10.0
set(COMMON_FLAGS -Wno-deprecated-register -Werror=format
-Werror=inconsistent-missing-override)
set(COMMON_FLAGS
-Wno-deprecated-register -Werror=format
-Werror=inconsistent-missing-override -Werror=braced-scalar-init)
endif()

if(WITH_HETERPS AND WITH_PSLIB)
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/eager/tests/task_tests/eager_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST(EagerUtils, AutoGradMeta) {
CHECK_NOTNULL(grad_node0.get());

EagerUtils::SetHistory(autograd_meta1, test_node);
EagerUtils::SetHistory({autograd_meta1}, test_node);
EagerUtils::SetHistory(autograd_meta1, test_node);
std::shared_ptr<GradNodeBase> grad_node1 = EagerUtils::grad_node(et1);
CHECK_NOTNULL(grad_node1.get());

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/imperative/prepared_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature,

auto iter = outs.find(output_names[i]);
if (iter == outs.end()) {
kernel_ctx->EmplaceBackOutputWithoutSetRange({nullptr});
kernel_ctx->EmplaceBackOutputWithoutSetRange(nullptr);
kernel_ctx->AssignOutputRange(std::make_pair(start_idx, start_idx + 1),
i);
continue;
Expand All @@ -358,7 +358,7 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature,

for (size_t offset = 0; offset < outs_vector.size(); ++offset) {
if (outs_vector[offset] == nullptr) {
kernel_ctx->EmplaceBackOutputWithoutSetRange({nullptr});
kernel_ctx->EmplaceBackOutputWithoutSetRange(nullptr);
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/ops/compat/concat_sig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ KernelSignature ConcatOpArgumentMapping(const ArgumentMappingContext& ctx) {
KernelSignature ConcatGradOpArgumentMapping(const ArgumentMappingContext& ctx) {
if (ctx.HasInput("AxisTensor")) {
return KernelSignature(
"concat_grad", {"X", {"Out@GRAD"}}, {"AxisTensor"}, {{"X@GRAD"}});
"concat_grad", {"X", "Out@GRAD"}, {"AxisTensor"}, {"X@GRAD"});
}
return KernelSignature(
"concat_grad", {"X", {"Out@GRAD"}}, {"axis"}, {{"X@GRAD"}});
"concat_grad", {"X", "Out@GRAD"}, {"axis"}, {"X@GRAD"});
}

} // namespace phi
Expand Down