未验证 提交 a482f6bf 编写于 作者: G Galaxy1458 提交者: GitHub

remove [-Wimplicit-fallthrough=] warning (#52783)

* test, test=develop

* test, test=develop

* test, test=develop
上级 189e0d44
......@@ -402,16 +402,12 @@ class ArgmaxOpTransformer
case paddle::framework::proto::AttrType::INT: {
auto axis = PADDLE_GET_CONST(int, (*attrs)["axis"]);
(*attrs)["axis"] = static_cast<int>(perm[axis]);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
}
case paddle::framework::proto::AttrType::LONG: {
auto axis = PADDLE_GET_CONST(int64_t, (*attrs)["axis"]);
(*attrs)["axis"] = static_cast<int64_t>(perm[axis]);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
}
default:
VLOG(4) << "The data_type of axis is Error, axis must be int or "
......
......@@ -1483,11 +1483,8 @@ void batch_norm_grad(const Tensor& x,
if (bias_grad) {
set_output<T>(out_grad_data_sum, bias_grad);
}
break;
}
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
}
default:
......
......@@ -691,9 +691,8 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break;
case 'X':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
case 'x':
case 'p':
out.setf(std::ios::hex, std::ios::basefield);
......@@ -701,26 +700,22 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break;
case 'E':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
case 'e':
out.setf(std::ios::scientific, std::ios::floatfield);
out.setf(std::ios::dec, std::ios::basefield);
break;
case 'F':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
case 'f':
out.setf(std::ios::fixed, std::ios::floatfield);
break;
case 'G':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
break;
case 'g':
out.setf(std::ios::dec, std::ios::basefield);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册