public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2904] ada: Fix printing of numbers in JSON output for data representation
@ 2023-08-01  8:08 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-08-01  8:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9a36d1d13dd2d93b44b06384e2d4b20fcc850cc5

commit r14-2904-g9a36d1d13dd2d93b44b06384e2d4b20fcc850cc5
Author: Yannick Moy <moy@adacore.com>
Date:   Wed Jul 19 17:57:30 2023 +0200

    ada: Fix printing of numbers in JSON output for data representation
    
    When calling GNAT with -gnatRj to generate JSON output for the
    data representation of types and objects, it could happen that
    numbers are printed in the Ada syntax for hexadecimal numbers, which
    leads to an invalid JSON file being generated. Now fixed both for
    the JSON output and the Ada-like output.
    
    gcc/ada/
    
            * repinfo.adb (Compute_Max_Length): Set parameter to print number
            in decimal notation.
            (List_Component_Layout): Same.

Diff:
---
 gcc/ada/repinfo.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index ba4b32b7027..ecd35e94e14 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -1100,7 +1100,7 @@ package body Repinfo is
                      goto Continue;
                   end if;
 
-                  UI_Image (Spos);
+                  UI_Image (Spos, Format => Decimal);
                else
                   --  If the record is not packed, then we know that all fields
                   --  whose position is not specified have starting normalized
@@ -1176,7 +1176,7 @@ package body Repinfo is
                Spos := Spos + 1;
             end if;
 
-            UI_Image (Spos);
+            UI_Image (Spos, Format => Decimal);
             Spaces (Max_Spos_Length - UI_Image_Length);
             Write_Str (UI_Image_Buffer (1 .. UI_Image_Length));

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

only message in thread, other threads:[~2023-08-01  8:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01  8:08 [gcc r14-2904] ada: Fix printing of numbers in JSON output for data representation Marc Poulhi?s

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).