public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-512] libstdc++: Use unsigned char argument to std::isdigit
@ 2021-05-05 12:00 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-05-05 12:00 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:d0d6ca019717305df0ef41e3fe1da48f7f561fac
commit r12-512-gd0d6ca019717305df0ef41e3fe1da48f7f561fac
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed May 5 11:19:55 2021 +0100
libstdc++: Use unsigned char argument to std::isdigit
Passing plain char to isdigit is undefined if the value is negative.
libstdc++-v3/ChangeLog:
* include/std/charconv (__from_chars_alnum): Pass unsigned
char to std::isdigit.
Diff:
---
libstdc++-v3/include/std/charconv | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index 193702e677a..571be075a6b 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -565,7 +565,7 @@ namespace __detail
while (__first != __last)
{
unsigned char __c = *__first;
- if (std::isdigit(__c))
+ if (std::isdigit(static_cast<unsigned char>(__c)))
__c -= '0';
else
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-05 12:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 12:00 [gcc r12-512] libstdc++: Use unsigned char argument to std::isdigit Jonathan Wakely
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).