From 4246cf4f18053eeb47cb2a241fffa9a41573916e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 27 Aug 2024 13:17:20 -0400 Subject: 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. --- libstdc++-v3/include/std/istream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libstdc++-v3/include/std/istream') 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. -- cgit v1.1