Re: where exactly c++,c fail and Ada gets thru'
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Mon, 24 Apr 2006 22:33:09 GMT
"jimmaureenrogers@xxxxxxxxxxxxxxxx" <jimmaureenrogers@xxxxxxxxxxxxxxxx> writes:
Ananth the Boss wrote:
we are developing safety critical software.my seniors say that c and
c++ are not suitable for safety critical software development and ada
is very much safe.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
The Coding Standards for the Joint Strike Fighter
http://public.research.att.com/~bs/JSF-AV-rules.pdf
give you an idea of the kinds of safety problems recognized in both
C and C++.
For example, the standard prohibits the use of C-style arrays as
function parameters. The problem cited is the degeneration of an
array function argument into a pointer. The pointer provides no
information about the size of the array it points to.
In fact, it's not possible in C to pass an array directly as a
function parameter. The language allows a parameter to be declared
with array syntax, but this is exactly equivalent to declaring it as a
pointer. For example, these two C declarations are exactly
equivalent:
void func(int arr[]);
void func(int *arr);
It's a common misconception that arrays are "really" pointers in C.
In fact they're not, but there are some features of the language
(certain implicit conversions, the above syntax for parameter
declarations) that can make it look that way. If you're curious about
the details, section 6 of the comp.lang.c FAQ has a good summary.
I haven't looked at the coding standards document in question.
Possibly it just forbids the use of array syntax to represent what's
really a pointer parameter. Forbidding pointer parameters would be a
serious problem; much of the standard library does this, and it's the
normal way to achieve the effect of passing an array.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: where exactly c++,c fail and Ada gets thru'
- From: Martin Krischik
- Re: where exactly c++,c fail and Ada gets thru'
- From: Jeffrey R. Carter
- Re: where exactly c++,c fail and Ada gets thru'
- References:
- where exactly c++,c fail and Ada gets thru'
- From: Ananth the Boss
- Re: where exactly c++,c fail and Ada gets thru'
- From: jimmaureenrogers@xxxxxxxxxxxxxxxx
- where exactly c++,c fail and Ada gets thru'
- Prev by Date: Re: where exactly c++,c fail and Ada gets thru'
- Next by Date: Re: where exactly c++,c fail and Ada gets thru'
- Previous by thread: Re: where exactly c++,c fail and Ada gets thru'
- Next by thread: Re: where exactly c++,c fail and Ada gets thru'
- Index(es):
Relevant Pages
|