未验证 提交 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
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
}
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
}
default:
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,
}
break;
}
#ifdef LINUX
__attribute__((fallthrough));
#endif
}
default:
PADDLE_THROW(phi::errors::InvalidArgument("Unknown storage order: %s",
data_layout));
......
......@@ -691,6 +691,9 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break;
case 'X':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
case 'x':
case 'p':
out.setf(std::ios::hex, std::ios::basefield);
......@@ -698,17 +701,27 @@ inline const char *streamStateFromFormat(std::ostream &out, // NOLINT
break;
case 'E':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
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
case 'f':
out.setf(std::ios::fixed, std::ios::floatfield);
break;
case 'G':
out.setf(std::ios::uppercase);
#ifdef LINUX
__attribute__((fallthrough));
#endif
case 'g':
out.setf(std::ios::dec, std::ios::basefield);
// 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.
先完成此消息的编辑!
想要评论请 注册