]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Format error in m2pp.cc (m2pp_integer_cst) [PR107234]
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 6 Feb 2023 18:50:18 +0000 (18:50 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 6 Feb 2023 18:50:18 +0000 (18:50 +0000)
Use HOST_WIDE_INT_PRINT_UNSIGNED instead of hardcoding a
specific format.

gcc/m2/ChangeLog:

* m2pp.cc (m2pp_integer_cst): Use
HOST_WIDE_INT_PRINT_UNSIGNED as the format specifier.

PR modula2/107234
    Co-Authored by: Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/m2pp.cc

index 3f4518074c8b84b9bbfed821c54a8edfff80f1aa..21d1cb9dce73bae6e8f6a6c56b0ec2b8dd9be74e 100644 (file)
@@ -2068,7 +2068,7 @@ m2pp_integer_cst (pretty *s, tree t)
 {
   char val[100];
 
-  snprintf (val, 100, "%lud", TREE_INT_CST_LOW (t));
+  snprintf (val, 100, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (t));
   m2pp_print (s, val);
 }