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

remove -Wimplicit-fallthrough (#52717)

* delete [-Wno-error=terminate], test=develop

* remove GPUps[-Wterminate],test=develop

* remove some -Wno-, test=develop

* modify ~MatmulDescriptor

* mess

* remove -Wimplicit-fallthrough, test=develop

* remove -Wimplicit-fallthrough, test=develop

* remove -Wimplicit-fallthrough, test=develop

* remove -Wimplicit-fallthrough, test=develop

* remove , test=develop
上级 10fd4a95
...@@ -402,10 +402,16 @@ class ArgmaxOpTransformer ...@@ -402,10 +402,16 @@ 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
__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
__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 "
......
...@@ -1485,7 +1485,11 @@ void batch_norm_grad(const Tensor& x, ...@@ -1485,7 +1485,11 @@ void batch_norm_grad(const Tensor& x,
} }
break; break;
} }
#ifdef LINUX
__attribute__((fallthrough));
#endif
} }
default: default:
PADDLE_THROW(phi::errors::InvalidArgument("Unknown storage order: %s", PADDLE_THROW(phi::errors::InvalidArgument("Unknown storage order: %s",
data_layout)); data_layout));
......
...@@ -691,6 +691,9 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT ...@@ -691,6 +691,9 @@ 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
__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);
...@@ -698,17 +701,27 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT ...@@ -698,17 +701,27 @@ 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
__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));
#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
__attribute__((fallthrough));
#endif
case 'g': case 'g':
out.setf(std::ios::dec, std::ios::basefield); out.setf(std::ios::dec, std::ios::basefield);
// As in boost::format, let stream decide float format. // As in boost::format, let stream decide float format.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册