https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124666

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jvdelisle at gcc dot 
gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-03-28
             Status|UNCONFIRMED                 |NEW

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I went ahead and audited the code. There are two places where we use this
technique.

diff --git a/gcc/fortran/io.cc b/gcc/fortran/io.cc
index 5bffed22eb8..2db2245351e 100644
--- a/gcc/fortran/io.cc
+++ b/gcc/fortran/io.cc
@@ -256,7 +256,7 @@ format_lex (void)
        {
          c = next_char_not_space ();
          if (ISDIGIT (c))
-           value = 10 * value + c - '0';
+           value = 10 * value + (c - '0');
        }
       while (ISDIGIT (c));

@@ -287,7 +287,7 @@ format_lex (void)
          c = next_char_not_space ();
          if (ISDIGIT (c))
            {
-             value = 10 * value + c - '0';
+             value = 10 * value + (c - '0');
              if (c != '0')
                zflag = 0;
            }

I will push this as simple and obvious after testing.

Reply via email to