public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1297] libstdc++: Resolve -Wsign-compare issue
@ 2023-05-26 11:01 Matthias Kretz
  0 siblings, 0 replies; only message in thread
From: Matthias Kretz @ 2023-05-26 11:01 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:1a1abec1d618cde709c585fcce89330bb33b07ac

commit r14-1297-g1a1abec1d618cde709c585fcce89330bb33b07ac
Author: Matthias Kretz <m.kretz@gsi.de>
Date:   Thu May 25 10:45:21 2023 +0200

    libstdc++: Resolve -Wsign-compare issue
    
    Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
    
    libstdc++-v3/ChangeLog:
    
            * include/experimental/bits/simd_ppc.h (_S_bit_shift_left):
            Negative __y is UB, so prefer signed compare.

Diff:
---
 libstdc++-v3/include/experimental/bits/simd_ppc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/experimental/bits/simd_ppc.h b/libstdc++-v3/include/experimental/bits/simd_ppc.h
index 2ea7234bd99..34daa530f02 100644
--- a/libstdc++-v3/include/experimental/bits/simd_ppc.h
+++ b/libstdc++-v3/include/experimental/bits/simd_ppc.h
@@ -64,7 +64,7 @@ template <typename _Abi, typename>
 	__x = _Base::_S_bit_shift_left(__x, __y);
 	if constexpr (sizeof(_Tp) < sizeof(int))
 	  {
-	    if (__y >= sizeof(_Tp) * __CHAR_BIT__)
+	    if (__y >= int(sizeof(_Tp) * __CHAR_BIT__))
 	      return {};
 	  }
 	return __x;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-26 11:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 11:01 [gcc r14-1297] libstdc++: Resolve -Wsign-compare issue Matthias Kretz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).