Re: where exactly c++,c fail and Ada gets thru'



Hi Ananth

Ananth the Boss wrote:

NASA aslo uses Ada.at what point c++ or c turns to be
not suitable for devleloping flight software. i may be wrong also. can
any one give some more justifications for telling "ADA is safe" thanks
in advance

Neither C nor C++ provides any standard means for detecting
overflow or underflow of numeric types.  C provides no way to
ensure that a numeric type uses only a valid set of values. C++
forces you to define a class wrapping the numeric value.

Just in case you have not read up on Ada typing here some pointers:

http://en.wikibooks.org/wiki/Ada_Programming/Types
http://en.wikibooks.org/wiki/Ada_Programming/Subtypes

Martin
--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.



Relevant Pages

  • Re: Typing in Ada
    ... > Ada, it would be more similar to using a subtype, perhaps. ... ability to define new numeric types. ... strength of typing in the 2 languages. ...
    (comp.lang.ada)
  • Re: C++0x and Threads - a poor relation to Adas tasking model?
    ... It's a common misconception that signed integers portably wrap. ... Not significantly as far as I can see; C++ says behaviour on overflow ... because it allows the compiler maximum flexibility for raw speed. ... between users of Ada and C++ in general. ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... The only safe use of C is as a target language for code generators ... Since I assume that the same thing applies to Ada ... be lighter in Ada sector and darker in the C sector, ... logically flawed reasoning. ...
    (comp.lang.ada)
  • Re: In-Out Parameters for functions
    ... Try writing a multiply routine that detects overflow without ... > the Ada mindset) was that the reason for l-d checks is to prevent the ... > trigger problems at some remove from the place where they occurred. ... Handling l-d checks requires great care. ...
    (comp.lang.ada)
  • Re: Selective suppression of warnings --- gnat on GNU/Linux
    ... overflow if X+Y is in Integer, ... if we're just talking about Ada. ... But we're talking about translating Pascal into Ada. ... to know something about the Pascal compiler. ...
    (comp.lang.ada)