From: Simon Wright <simon@pushface.org>
Subject: Re: Compiler checking of String lengths during assignment (Newbie Question)
Date: Fri, 09 Jan 2015 23:10:20 +0000
Date: 2015-01-09T23:10:20+00:00 [thread overview]
Message-ID: <lyoaq7h7oj.fsf@pushface.org> (raw)
In-Reply-To: 77d434cc-00bc-4a2f-b50e-40736abdd2b2@googlegroups.com
isaac1.0@gmail.com writes:
> 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.
> The 3rd assignment there does NOT produce an error, no warning no
> nothing even though this clearly violates the same check.
>
> What does happen is that at runtime the execution is incorrect. It
> doesn't even terminate in a horrible disaster (which would be
> preferable). The full program actually just reads a text file (for
> now) and in this case because the assigned length is incorrect, it
> just reads a few lines then bails claiming unable to read the text
> file.
This sounds as if it might be related to GCC PR ada/61466[1]. Are you
optimising?
> Aren't Ada compilers supposed to prevent stupid errors like this? Or
> is there some user stupidity here that I'm not seeing...?
Sometimes compilers do have bugs.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61466
next prev parent reply other threads:[~2015-01-09 23:10 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 [this message]
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
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