https://gcc.gnu.org/g:fac69bd389303362efc0ae6e86fc08f3fe99946a
commit r15-6147-gfac69bd389303362efc0ae6e86fc08f3fe99946a Author: Ronan Desplanques <desplanq...@adacore.com> Date: Tue Nov 19 16:51:44 2024 +0100 ada: Fix reference manual clauses The clauses in section 3.5 of the reference manual were moved around along the different Ada versions, which caused some comments in our source code to go out of date. This patch updates the references in those comments. gcc/ada/ChangeLog: * libgnat/a-tifiio.adb: Fix comment. * libgnat/a-tifiio__128.adb: Likewise. * libgnat/s-imaged.ads (Image_Decimal): Likewise. * libgnat/s-imagef.ads (Image_Fixed): Likewise. * libgnat/s-imager.ads (Image_Fixed_Point): Likewise. * libgnat/s-imde32.ads (Image_Decimal32): Likewise. * libgnat/s-imfi64.ads (Image_Fixed64): Likewise. * libgnat/s-imgcha.adb (Image_Character): Likewise. * libgnat/s-valuer.adb (Scan_Raw_Real): Likewise. * sem_attr.adb (Eval_Attribute): Likewise. Diff: --- gcc/ada/libgnat/a-tifiio.adb | 2 +- gcc/ada/libgnat/a-tifiio__128.adb | 2 +- gcc/ada/libgnat/s-imaged.ads | 2 +- gcc/ada/libgnat/s-imagef.ads | 2 +- gcc/ada/libgnat/s-imager.ads | 8 ++++---- gcc/ada/libgnat/s-imde32.ads | 2 +- gcc/ada/libgnat/s-imfi64.ads | 2 +- gcc/ada/libgnat/s-imgcha.adb | 5 +++-- gcc/ada/libgnat/s-valuer.adb | 2 +- gcc/ada/sem_attr.adb | 5 +++-- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/gcc/ada/libgnat/a-tifiio.adb b/gcc/ada/libgnat/a-tifiio.adb index c44b2ba36f78..7358d1233137 100644 --- a/gcc/ada/libgnat/a-tifiio.adb +++ b/gcc/ada/libgnat/a-tifiio.adb @@ -69,7 +69,7 @@ -- Operations -- ---------- --- [Wide_[Wide_]]Image attribute (see RM 3.5(27.1/2)) +-- [Wide_[Wide_]]Image attribute (see RM 4.10(30)) -- These attributes return a decimal real literal best approximating -- the value (rounded away from zero if halfway between) with a diff --git a/gcc/ada/libgnat/a-tifiio__128.adb b/gcc/ada/libgnat/a-tifiio__128.adb index 51b4b219ff79..59ce81cc706c 100644 --- a/gcc/ada/libgnat/a-tifiio__128.adb +++ b/gcc/ada/libgnat/a-tifiio__128.adb @@ -69,7 +69,7 @@ -- Operations -- ---------- --- [Wide_[Wide_]]Image attribute (see RM 3.5(27.1/2)) +-- [Wide_[Wide_]]Image attribute (see RM 4.10(30)) -- These attributes return a decimal real literal best approximating -- the value (rounded away from zero if halfway between) with a diff --git a/gcc/ada/libgnat/s-imaged.ads b/gcc/ada/libgnat/s-imaged.ads index c9017d11e313..d9debde3c27d 100644 --- a/gcc/ada/libgnat/s-imaged.ads +++ b/gcc/ada/libgnat/s-imaged.ads @@ -48,7 +48,7 @@ package System.Image_D is -- Computes fixed_type'Image (V), where V is the integer value (in units of -- delta) of a decimal type whose Scale is as given and stores the result -- S (1 .. P), updating P on return. The result is computed according to - -- the rules for image for fixed-point types (RM 3.5(34)). The caller + -- the rules for image for fixed-point types (RM 4.10(14)). The caller -- guarantees that S is long enough to hold the result and has a lower -- bound of 1. diff --git a/gcc/ada/libgnat/s-imagef.ads b/gcc/ada/libgnat/s-imagef.ads index bcb3aee15faa..277559dcb9d3 100644 --- a/gcc/ada/libgnat/s-imagef.ads +++ b/gcc/ada/libgnat/s-imagef.ads @@ -56,7 +56,7 @@ package System.Image_F is -- Computes fixed_type'Image (V), where V is the integer value (in units of -- small) of an ordinary fixed point type with small Num/Den, and stores -- the result in S (1 .. P), updating P on return. The result is computed - -- according to the rules for image for fixed-point types (RM 3.5(34)). + -- according to the rules for image for fixed-point types (RM 4.10(14)). -- For0 and Aft0 are the values of the Fore and Aft attributes for the -- fixed point type whose mantissa type is Int and whose small is Num/Den. -- This function is used only for fixed point whose Small is the ratio of diff --git a/gcc/ada/libgnat/s-imager.ads b/gcc/ada/libgnat/s-imager.ads index 700582bfda59..826815588ad5 100644 --- a/gcc/ada/libgnat/s-imager.ads +++ b/gcc/ada/libgnat/s-imager.ads @@ -56,7 +56,7 @@ package System.Image_R is Aft : Natural); -- Computes fixed_type'Image (V) and returns the result in S (1 .. P) -- updating P on return. The result is computed according to the rules for - -- image for fixed-point types (RM 3.5(34)), where Aft is the value of the + -- image for fixed-point types (RM 4.10(14)), where Aft is the value of the -- Aft attribute for the fixed-point type. The caller guarantees that S is -- long enough to hold the result and has a lower bound of 1. -- @@ -69,9 +69,9 @@ package System.Image_R is Digs : Natural); -- Computes Uns'Image (V) and returns the result in S (1 .. P) updating P -- on return. The result is computed according to the rules for image for - -- floating-point types (RM 3.5(33)), where Digs is the value of the Digits - -- attribute for the floating-point type. The caller guarantees that S is - -- long enough to hold the result and has a lower bound of 1. + -- floating-point types (RM 4.10(13)), where Digs is the value of the + -- Digits attribute for the floating-point type. The caller guarantees that + -- S is long enough to hold the result and has a lower bound of 1. procedure Set_Image_Real (V : Num; diff --git a/gcc/ada/libgnat/s-imde32.ads b/gcc/ada/libgnat/s-imde32.ads index b048c4870141..335fd955099e 100644 --- a/gcc/ada/libgnat/s-imde32.ads +++ b/gcc/ada/libgnat/s-imde32.ads @@ -52,7 +52,7 @@ package System.Img_Decimal_32 is -- Computes fixed_type'Image (V), where V is the integer value (in units of -- delta) of a decimal type whose Scale is as given and stores the result -- S (1 .. P), updating P on return. The result is computed according to - -- the rules for image for fixed-point types (RM 3.5(34)). The caller + -- the rules for image for fixed-point types (RM 4.10(14)). The caller -- guarantees that S is long enough to hold the result and has a lower -- bound of 1. diff --git a/gcc/ada/libgnat/s-imfi64.ads b/gcc/ada/libgnat/s-imfi64.ads index 4e10e031ba19..06a54174f81c 100644 --- a/gcc/ada/libgnat/s-imfi64.ads +++ b/gcc/ada/libgnat/s-imfi64.ads @@ -55,7 +55,7 @@ package System.Img_Fixed_64 is -- Computes fixed_type'Image (V), where V is the integer value (in units of -- small) of an ordinary fixed point type with small Num/Den, and stores -- the result in S (1 .. P), updating P on return. The result is computed - -- according to the rules for image for fixed-point types (RM 3.5(34)). + -- according to the rules for image for fixed-point types (RM 4.10(14)). -- For0 and Aft0 are the values of the Fore and Aft attributes for the -- fixed point type whose mantissa type is Int64 and whose small is -- Num/Den. This function is used only for fixed point whose Small is an diff --git a/gcc/ada/libgnat/s-imgcha.adb b/gcc/ada/libgnat/s-imgcha.adb index 65b411df5bf8..5de5324c2ae6 100644 --- a/gcc/ada/libgnat/s-imgcha.adb +++ b/gcc/ada/libgnat/s-imgcha.adb @@ -120,7 +120,7 @@ package body System.Img_Char is Character'Val (16#9F#) => "APC"]; begin - -- Control characters are represented by their names (RM 3.5(32)) + -- Control characters are represented by their names (RM 4.10(12)) if V in C0_Range then S (1 .. 3) := C0 (V); @@ -152,7 +152,8 @@ package body System.Img_Char is end; end if; - -- Normal characters yield the character enclosed in quotes (RM 3.5(32)) + -- Normal characters yield the character enclosed in quotes + -- (RM 4.10(12)). else S (1) := '''; diff --git a/gcc/ada/libgnat/s-valuer.adb b/gcc/ada/libgnat/s-valuer.adb index e6b8698e5f78..619bc0824560 100644 --- a/gcc/ada/libgnat/s-valuer.adb +++ b/gcc/ada/libgnat/s-valuer.adb @@ -585,7 +585,7 @@ package body System.Value_R is (Str, Index, Max, Base, False, Value, Scale, N, Char_As_Digit (Extra), Base_Violation); - -- A dot is allowed only if followed by a digit (RM 3.5(47)) + -- A dot is allowed only if followed by a digit (RM 3.5(39.8)) elsif Str (Index) = '.' and then Index < Max diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 2315d515ac4d..2c17aef1528f 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -10724,7 +10724,7 @@ package body Sem_Attr is else -- For floating-point, we have +N.dddE+nnn where length -- of ddd is determined by type'Digits - 1, but is one - -- if Digits is one (RM 3.5 (33)). + -- if Digits is one (RM 4.10 (13)). -- nnn is set to 2 for Short_Float and Float (32 bit -- floats), and 3 for Long_Float and Long_Long_Float. @@ -10762,7 +10762,8 @@ package body Sem_Attr is -- The non-null case depends on the specific real type else - -- For fixed-point type width is Fore + 1 + Aft (RM 3.5(34)) + -- For fixed-point type width is Fore + 1 + Aft + -- (RM 4.10(14)). Fold_Uint (N, UI_From_Int (Fore_Value + 1) + Aft_Value (P_Type),