mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-13 17:34:45 +08:00
Restrict mention of -Wstringop-overflow to gcc >= 11
This commit is contained in:
parent
0e65940a7f
commit
575fc23c3c
@ -6527,12 +6527,12 @@ read(std::basic_istream<CharT, Traits>& is, int a0, Args&& ...args)
|
|||||||
*e++ = static_cast<CharT>(CharT(u % 10) + CharT{'0'});
|
*e++ = static_cast<CharT>(CharT(u % 10) + CharT{'0'});
|
||||||
u /= 10;
|
u /= 10;
|
||||||
} while (u > 0);
|
} while (u > 0);
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && __GNUC__ >= 11
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
#endif
|
#endif
|
||||||
std::reverse(buf, e);
|
std::reverse(buf, e);
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && __GNUC__ >= 11
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
for (auto p = buf; p != e && is.rdstate() == std::ios::goodbit; ++p)
|
for (auto p = buf; p != e && is.rdstate() == std::ios::goodbit; ++p)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user