comp.lang.ada
 help / color / mirror / Atom feed
* What would be the Ada solution?
@ 2011-02-04 16:33 KK6GM
  2011-02-04 16:38 ` Mark Lorenzen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: KK6GM @ 2011-02-04 16:33 UTC (permalink / raw)


A colleague is working on some old code, written in C, that uses an
"out of range" integer value to indicate no valid value.  Thus, a
default value (in this case 0x7FFFFFFF) means no value has been
entered.  All code that uses any values should check for this no-value
and act accordingly, but of course not all the code actually does
that, and there are odd cases where the no-value value gets processed
as a valid value and then Bad Things Happen.

I'm curious what the Ada approach to this issue would be, the issue
being to differentiate between valid and invalid values, and to catch
(compile time or run time) any manipulation of an invalid value as if
it were a valid value.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-04 19:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04 16:33 What would be the Ada solution? KK6GM
2011-02-04 16:38 ` Mark Lorenzen
2011-02-04 16:57 ` Robert A Duff
2011-02-04 18:59   ` Georg Bauhaus
2011-02-04 19:33     ` Robert A Duff
2011-02-04 17:14 ` mockturtle
2011-02-04 17:47   ` Robert A Duff
2011-02-04 17:26 ` Dmitry A. Kazakov
2011-02-04 17:38 ` Robert A Duff

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