Use strtol instead of std::stoi in gensupport.cc

Message ID ZLgyqE97WQkOyZc+@mx3210.localdomain
State Unresolved
Headers
Series Use strtol instead of std::stoi in gensupport.cc |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

John David Anglin July 19, 2023, 6:59 p.m. UTC
  Tested on trunk with hppa64-hp-hpux11.11.

Okay?

Dave
---

Use strtol instead of std::stoi [PR110646]

Implementation of std::stoi was overlooked on hppa-hpux, so use
strtol instead.

2023-07-19  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	PR bootstrap/110646
	* gensupport.cc(class conlist): Use strtol instead of std::stoi.
  

Comments

John David Anglin Aug. 10, 2023, 7:27 p.m. UTC | #1
Ping.

On 2023-07-19 2:59 p.m., John David Anglin wrote:
> Tested on trunk with hppa64-hp-hpux11.11.
>
> Okay?
>
> Dave
> ---
>
> Use strtol instead of std::stoi [PR110646]
>
> Implementation of std::stoi was overlooked on hppa-hpux, so use
> strtol instead.
>
> 2023-07-19  John David Anglin  <danglin@gcc.gnu.org>
>
> gcc/ChangeLog:
>
> 	PR bootstrap/110646
> 	* gensupport.cc(class conlist): Use strtol instead of std::stoi.
>
> diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
> index 959d1d9c83c..87bcf5ee441 100644
> --- a/gcc/gensupport.cc
> +++ b/gcc/gensupport.cc
> @@ -640,7 +640,7 @@ public:
>   
>       name.assign (ns, len);
>       if (numeric)
> -      idx = std::stoi (name);
> +      idx = strtol (name.c_str (), (char **)NULL, 10);
>     }
>   
>     /* Adds a character to the end of the string.  */
  
Jeff Law Aug. 11, 2023, 3:11 p.m. UTC | #2
On 8/10/23 13:27, John David Anglin wrote:
> Ping.
> 
> On 2023-07-19 2:59 p.m., John David Anglin wrote:
>> Tested on trunk with hppa64-hp-hpux11.11.
>>
>> Okay?
>>
>> Dave
>> ---
>>
>> Use strtol instead of std::stoi [PR110646]
>>
>> Implementation of std::stoi was overlooked on hppa-hpux, so use
>> strtol instead.
>>
>> 2023-07-19  John David Anglin  <danglin@gcc.gnu.org>
>>
>> gcc/ChangeLog:
>>
>>     PR bootstrap/110646
>>     * gensupport.cc(class conlist): Use strtol instead of std::stoi.
OK.  Sorry this got missed.

jeff
  

Patch

diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
index 959d1d9c83c..87bcf5ee441 100644
--- a/gcc/gensupport.cc
+++ b/gcc/gensupport.cc
@@ -640,7 +640,7 @@  public:
 
     name.assign (ns, len);
     if (numeric)
-      idx = std::stoi (name);
+      idx = strtol (name.c_str (), (char **)NULL, 10);
   }
 
   /* Adds a character to the end of the string.  */