未验证 提交 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 ...@@ -402,16 +402,12 @@ class ArgmaxOpTransformer
case paddle::framework::proto::AttrType::INT: { case paddle::framework::proto::AttrType::INT: {
auto axis = PADDLE_GET_CONST(int, (*attrs)["axis"]); auto axis = PADDLE_GET_CONST(int, (*attrs)["axis"]);
(*attrs)["axis"] = static_cast<int>(perm[axis]); (*attrs)["axis"] = static_cast<int>(perm[axis]);
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
} }
case paddle::framework::proto::AttrType::LONG: { case paddle::framework::proto::AttrType::LONG: {
auto axis = PADDLE_GET_CONST(int64_t, (*attrs)["axis"]); auto axis = PADDLE_GET_CONST(int64_t, (*attrs)["axis"]);
(*attrs)["axis"] = static_cast<int64_t>(perm[axis]); (*attrs)["axis"] = static_cast<int64_t>(perm[axis]);
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
} }
default: default:
VLOG(4) << "The data_type of axis is Error, axis must be int or " 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, ...@@ -1483,11 +1483,8 @@ void batch_norm_grad(const Tensor& x,
if (bias_grad) { if (bias_grad) {
set_output<T>(out_grad_data_sum, bias_grad); set_output<T>(out_grad_data_sum, bias_grad);
} }
break;
} }
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
} }
default: default:
......
...@@ -691,9 +691,8 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT ...@@ -691,9 +691,8 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break; break;
case 'X': case 'X':
out.setf(std::ios::uppercase); out.setf(std::ios::uppercase);
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
case 'x': case 'x':
case 'p': case 'p':
out.setf(std::ios::hex, std::ios::basefield); out.setf(std::ios::hex, std::ios::basefield);
...@@ -701,26 +700,22 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT ...@@ -701,26 +700,22 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break; break;
case 'E': case 'E':
out.setf(std::ios::uppercase); out.setf(std::ios::uppercase);
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
case 'e': case 'e':
out.setf(std::ios::scientific, std::ios::floatfield); out.setf(std::ios::scientific, std::ios::floatfield);
out.setf(std::ios::dec, std::ios::basefield); out.setf(std::ios::dec, std::ios::basefield);
break; break;
case 'F': case 'F':
out.setf(std::ios::uppercase); out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough)); break;
#endif
case 'f': case 'f':
out.setf(std::ios::fixed, std::ios::floatfield); out.setf(std::ios::fixed, std::ios::floatfield);
break; break;
case 'G': case 'G':
out.setf(std::ios::uppercase); out.setf(std::ios::uppercase);
#ifdef LINUX break;
__attribute__((fallthrough));
#endif
case 'g': case 'g':
out.setf(std::ios::dec, std::ios::basefield); 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.
先完成此消息的编辑!
想要评论请 注册