[Ada] Fix PR ada/53996

Submitted by Eric Botcazou on Dec. 15, 2012, 5:47 p.m.

Details

Message ID 1438918.O2MkPNOEJC@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 15, 2012, 5:47 p.m.
As reported by Martin, there is a small inconsistency in gnat_type_for_size, 
where %d is used instead of %u for an unsigned value in a format string.

Tested on x86_64-suse-linux, applied on the mainline.


2012-12-15  Eric Botcazou  <ebotcazou@adacore.com>
            Martin Ettl  <ettl.martin@gmx.de>

	PR ada/53996
	* gcc-interface/utils.c (gnat_type_for_size): Use %u in lieu of %d.

Patch hide | download patch | download mbox

Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 194517)
+++ gcc-interface/utils.c	(working copy)
@@ -2797,7 +2797,7 @@  gnat_type_for_size (unsigned precision,
 
   if (!TYPE_NAME (t))
     {
-      sprintf (type_name, "%sSIGNED_%d", unsignedp ? "UN" : "", precision);
+      sprintf (type_name, "%sSIGNED_%u", unsignedp ? "UN" : "", precision);
       TYPE_NAME (t) = get_identifier (type_name);
     }