comp.lang.ada
 help / color / mirror / Atom feed
From: Stefan.Lucks@uni-weimar.de
Subject: Re: Compiler checking of String lengths during assignment (Newbie Question)
Date: Sat, 10 Jan 2015 00:20:11 +0100
Date: 2015-01-10T00:20:11+01:00	[thread overview]
Message-ID: <alpine.DEB.2.11.1501100017300.19658@debian> (raw)
In-Reply-To: <lyoaq7h7oj.fsf@pushface.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 855 bytes --]

On Fri, 9 Jan 2015, Simon Wright wrote:

>> The first 2 cases produces an error during the build, as expected,
>> because Head is known to be length of 5 and I'm assigning something of
>> a different length.

I believe, all three should generate a run-time error (most likely a 
Constraint_Error).

But a good compiler should also warn you about the run-time error, and 
maybe you have set your compiler to treat warnings as errors (which is
not a bad idea).

>> The 3rd assignment there does NOT produce an error, no warning no
>> nothing even though this clearly violates the same check.

This is a compiler bug!


------  I  love  the  taste  of  Cryptanalysis  in  the morning!  ------
     <http://www.uni-weimar.de/cms/medien/mediensicherheit/home.html>
--Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany--

  reply	other threads:[~2015-01-09 23:20 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 [this message]
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
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