diff --git a/paddle/fluid/imperative/layout_transformer.h b/paddle/fluid/imperative/layout_transformer.h index 93c924a095c9ee82f40e920fd36aca01ba3398f3..2bdbead6aae0d97c8faef8f504ecbaa66203e1ea 100644 --- a/paddle/fluid/imperative/layout_transformer.h +++ b/paddle/fluid/imperative/layout_transformer.h @@ -402,16 +402,12 @@ class ArgmaxOpTransformer case paddle::framework::proto::AttrType::INT: { auto axis = PADDLE_GET_CONST(int, (*attrs)["axis"]); (*attrs)["axis"] = static_cast(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(perm[axis]); -#ifdef LINUX - __attribute__((fallthrough)); -#endif + break; } default: VLOG(4) << "The data_type of axis is Error, axis must be int or " diff --git a/paddle/fluid/prim/api/composite_backward/composite_backward_api.h b/paddle/fluid/prim/api/composite_backward/composite_backward_api.h index 6697f1a614c3818803539edf4c9595de046d22ff..c0830b2a754280c6e0f534650380134b8d147eb8 100644 --- a/paddle/fluid/prim/api/composite_backward/composite_backward_api.h +++ b/paddle/fluid/prim/api/composite_backward/composite_backward_api.h @@ -1483,11 +1483,8 @@ void batch_norm_grad(const Tensor& x, if (bias_grad) { set_output(out_grad_data_sum, bias_grad); } - break; } -#ifdef LINUX - __attribute__((fallthrough)); -#endif + break; } default: diff --git a/paddle/utils/string/tinyformat/tinyformat.h b/paddle/utils/string/tinyformat/tinyformat.h index bd8d47849db96612c69fa4992e6f372e5a11e0a6..41319c391455e64b5c2d5d15bcc9badf3f0044a7 100644 --- a/paddle/utils/string/tinyformat/tinyformat.h +++ b/paddle/utils/string/tinyformat/tinyformat.h @@ -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);