aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/istream
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-08-27 13:17:20 -0400
committerJason Merrill <jason@redhat.com>2024-08-28 07:25:09 -0400
commit4246cf4f18053eeb47cb2a241fffa9a41573916e (patch)
treef73b4ef6bfef1b2ddbccd2a0b0aa9a090d811b8d /libstdc++-v3/include/std/istream
parent3f51f0dc88ec21c1ec79df694200f10ef85915f4 (diff)
downloadgcc-4246cf4f18053eeb47cb2a241fffa9a41573916e.zip
gcc-4246cf4f18053eeb47cb2a241fffa9a41573916e.tar.gz
gcc-4246cf4f18053eeb47cb2a241fffa9a41573916e.tar.bz2
libstdc++: avoid -Wsign-compare
-Wsign-compare complained about these comparisons between (unsigned) size_t and (signed) streamsize, or between (unsigned) native_handle_type and (signed) -1. Fixed by adding casts to unify the types. libstdc++-v3/ChangeLog: * include/std/istream: Add cast to avoid -Wsign-compare. * include/std/stacktrace: Likewise.
Diffstat (limited to 'libstdc++-v3/include/std/istream')
-rw-r--r--libstdc++-v3/include/std/istream2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index a2b207d..730e413 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -909,7 +909,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__n /= sizeof(_CharT);
streamsize __w = __in.width();
std::__istream_extract(__in, __s, __n);
- if (__in.good() && (__w <= 0 || __n < __w))
+ if (__in.good() && (__w <= 0 || __n < (size_t)__w))
{
// Stopped extracting early to avoid overflowing the buffer,
// but might have stopped anyway (and set eofbit) if at EOF.