comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Compiler checking of String lengths during assignment (Newbie Question)
Date: Thu, 15 Jan 2015 21:18:50 +0000
Date: 2015-01-15T21:18:50+00:00	[thread overview]
Message-ID: <ly8uh3hhdx.fsf@pushface.org> (raw)
In-Reply-To: 93725194-bf90-400f-844f-7d0d49adf030@googlegroups.com

isaac1.0@gmail.com writes:

> One is the compiler. Mine says GNAT GPL 2014 (20140331) and gcc is 4.7.4
>
> gcc -c -I- -gnatA E:\Projects\Test\src\main.adb
> main.adb:23:27: warning: wrong length for array of subtype of
> "Standard.String" defined at line 9
> main.adb:23:27: warning: "Constraint_Error" will be raised at run time
> main.adb:24:27: warning: too few elements for subtype of
> "Standard.String" defined at line 9
> main.adb:24:27: warning: "Constraint_Error" will be raised at run time
>
> So I get the 2 warnings that are expected, but the 3rd one is
> missed. I'm no compiler expert, but if you say it's difficult for the
> compiler to sort out arithmetic logic like that, then maybe this is
> the case. If a newer compiler is not showing the problem, then maybe
> this has already been solved.

As I think I've said before, with the same compiler (on Mac OS X, but
I'd be _very_ surprised if that made a difference) I get warnings on all
three lines.

  reply	other threads:[~2015-01-15 21:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 22:50 Compiler checking of String lengths during assignment (Newbie Question) isaac1.0
2015-01-09 23:10 ` Simon Wright
2015-01-09 23:20   ` Stefan.Lucks
2015-01-10 12:43     ` Brian Drummond
2015-01-09 23:53 ` Shark8
2015-01-10  0:18 ` Jeffrey Carter
2015-01-10  1:48 ` Adam Beneschan
2015-01-10 10:03 ` Pascal Obry
2015-01-10 10:54 ` Simon Wright
2015-01-15 20:44 ` isaac1.0
2015-01-15 21:18   ` Simon Wright [this message]
2015-01-15 22:30     ` Jeffrey Carter
2015-01-15 22:32     ` Jeffrey Carter
2015-01-16  7:28       ` Simon Wright
2015-01-16 15:44         ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox