https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81087
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2017-06-14 CC| |ebotcazou at gcc dot gnu.org Summary|ada: array index out of |array index out of range in |range in gnatlink, making |gnatlink, making test |test always false |always false Ever confirmed|0 |1 --- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > The procedure gnatlink assumes that the Linker_Options.Table contains access > values to strings whose 'First index is always 1. This assumption is wrong > for the string returned by function Base_Name. > > The wrong indices are not detected because gnatlink is compiled with -gnatp, > but some test results are always wrong. So can you write a testcase which demonstrates the malfunction of gnatlink? > For example, this program normally raises Constraint_Error, but prints > "FALSE" if compiled with -gnatn. > procedure A is > G : constant String (3 .. 5) := "abc"; > begin > Ada.Text_IO.Put_Line (Boolean'Image (G (1 .. 2) = "ab")); > end A; s/-gnatn/-gnatp I presume.