Patchwork [Ada] Fix PR ada/53996

login
register
mail settings
Submitter Eric Botcazou
Date Dec. 15, 2012, 5:47 p.m.
Message ID <1438918.O2MkPNOEJC@polaris>
Download mbox | patch
Permalink /patch/206631/
State New
Headers show

Comments

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

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);
     }