Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MISRA-C++

15 views
Skip to first unread message

Chris H

unread,
May 28, 2008, 12:40:47 PM5/28/08
to

Hi

The long awaited MISRA-C++ will be launched on the 5th of June in London
at the Safety Critical Systems Club Tools Event.

http://www.safety-club.org.uk/diary.html?opt=detail&id=70


From the 5th of June MISRA-C++ will be available from MISRA

Http://www.misra-c.com/index.htm

there will also be a discussion forum as well.

Http://www.misra-c.com/forum/index.php
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

marlow...@googlemail.com

unread,
May 30, 2008, 2:27:38 PM5/30/08
to
On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
> The long awaited MISRA-C++ will be launched on the 5th of June in London
> at the Safety Critical Systems Club Tools Event.
>
> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>
> From the 5th of June MISRA-C++ will be available from MISRA
>
> Http://www.misra-c.com/index.htm

Just to point out for those not in the know, MISRA stands for The
Motor Industry Software Reliability Association. Whilst I am sure that
the motor industry as very concerned about safety there are other
organisations that are also concerned and not all of these permit the
use of C++ no matter how many guidelines there are. For example, it is
not generally permitted by the CAA (the Civil Aviation Authority, in
the UK). The CAA prefers languages like Ada and in general seems to
shy away from OO languages (with the possible exception of the OO
extensions to Ada).

I am interested in what these guidelines would have to say though.
Presumably they will be able to non-MISRA members?

Regards,

Andrew Marlow

--

peter koch larsen

unread,
May 30, 2008, 6:10:55 PM5/30/08
to
On 30 Maj, 20:27, marlow.and...@googlemail.com wrote:
> On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>
> > The long awaited MISRA-C++ will be launched on the 5th of June in London
> > at the Safety Critical Systems Club Tools Event.
>
> >http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>
> > From the 5th of June MISRA-C++ will be available from MISRA
>
> > Http://www.misra-c.com/index.htm
>
> Just to point out for those not in the know, MISRA stands for The
> Motor Industry Software Reliability Association. Whilst I am sure that
> the motor industry as very concerned about safety there are other
> organisations that are also concerned and not all of these permit the
> use of C++ no matter how many guidelines there are. For example, it is
> not generally permitted by the CAA (the Civil Aviation Authority, in
> the UK).

That must be specific for the UK only. Other places in Europe, C++ is
quite widespread - and if you just go to Ireland, large parts of their
software is in C++ (or Ada).

> The CAA prefers languages like Ada and in general seems to
> shy away from OO languages (with the possible exception of the OO
> extensions to Ada).

This is really to bad: C++ is IMO a better fit than Ada in a lot of
avionics software. Also, C++ is put to good use in lots of "avionics"
software - also on board airplanes (one example being the JSF).
I really would like to hear their argument for this ban.

/Peter

Peter C. Chapin

unread,
May 31, 2008, 4:06:34 AM5/31/08
to
peter koch larsen wrote:

>> The CAA prefers languages like Ada and in general seems to
>> shy away from OO languages (with the possible exception of the OO
>> extensions to Ada).
>
> This is really to bad: C++ is IMO a better fit than Ada in a lot of
> avionics software.

I'm not saying you are right or wrong, but I am curious about your
reasons for saying this.

jimmaure...@worldnet.att.net

unread,
May 31, 2008, 4:29:32 AM5/31/08
to
On May 30, 4:10 pm, peter koch larsen <peter.koch.lar...@gmail.com>
wrote:

> This is really to bad: C++ is IMO a better fit than Ada in a lot of
> avionics software. Also, C++ is put to good use in lots of "avionics"
> software - also on board airplanes (one example being the JSF).
> I really would like to hear their argument for this ban.

Opinions are all equally good in the absence of data.

The CAA has a strong bias towards languages, or their subsets, that
support formal correctness proofs. Subsets of Ada have been more
successful
in this area than subsets of C++.

The MISRA C++ standard may cause the CAA to re-evaluate their current
position on C++. Only time will tell. Other C++ subsets have been met
with varying degrees of acceptance in the C++ community. The EC++
subset is an example of another attempt to create a subset of C++
useful for safety-critical applications.

Jim Rogers

Chris H

unread,
Jun 1, 2008, 5:01:40 AM6/1/08
to
In message
<cbc4c906-e221-482b...@w5g2000prd.googlegroups.com>,
"jimmaure...@worldnet.att.net" <jimmaure...@worldnet.att.net>
writes

>On May 30, 4:10 pm, peter koch larsen <peter.koch.lar...@gmail.com>
>wrote:
>> This is really to bad: C++ is IMO a better fit than Ada in a lot of
>> avionics software. Also, C++ is put to good use in lots of "avionics"
>> software - also on board airplanes (one example being the JSF).
>> I really would like to hear their argument for this ban.
>
>Opinions are all equally good in the absence of data.
>
>The CAA has a strong bias towards languages, or their subsets, that
>support formal correctness proofs. Subsets of Ada have been more
>successful
>in this area than subsets of C++.

I agree.

>The MISRA C++ standard may cause the CAA to re-evaluate their current
>position on C++.

I have no comment on that other than it was my understand that C++ is
used on the JSF (Joint Strike Fighter, USA) because they could not find
enough Ada programmers.....

I would hope if the CAA change their stance it is for empirical reasons
other than the commercial one of a shortage of good programmers!

> Only time will tell. Other C++ subsets have been met
>with varying degrees of acceptance in the C++ community. The EC++
>subset is an example of another attempt to create a subset of C++
>useful for safety-critical applications.

EC++ is a bit of a pigs ear in the way it is implemented and not easy to
read.

I believe EC++ came about as a way of restricting C++ to an
intersection of the safer parts of C++ and the parts of C++ that
embedded compiler writers could reliably and consistently implement.

That may sound odd but remember that 10 years on most of the worlds C
compilers do not track the current C standard C9899:1999


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris H

unread,
Jun 1, 2008, 5:00:42 AM6/1/08
to
{ Warning: topic drift. This thread is getting little C++ content.
Please try to stay on topic, or move elsewhere. -mod }


In message
<0cb9ce90-3c65-4b35...@d77g2000hsb.googlegroups.com>,
marlow...@googlemail.com writes


>On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>> The long awaited MISRA-C++ will be launched on the 5th of June in London
>> at the Safety Critical Systems Club Tools Event.
>>
>> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>>
>> From the 5th of June MISRA-C++ will be available from MISRA
>>
>> Http://www.misra-c.com/index.htm
>
>Just to point out for those not in the know, MISRA stands for The
>Motor Industry Software Reliability Association.

Well it did when the firstr guidelines were started 15 years ago. Now
MIRA the parent body does
Automotive
Defence
Aerospace
Marine
Rail

Likewise the MISRA C first edition in 1998 was for C for Vehicle safety
the 2004 version was for "critical systems"

The MISRA C and C++ teams are NOT automotive biased at al these days.

> Whilst I am sure that
>the motor industry as very concerned about safety there are other
>organisations that are also concerned and not all of these permit the
>use of C++ no matter how many guidelines there are.

Very true.

> For example, it is
>not generally permitted by the CAA (the Civil Aviation Authority, in
>the UK). The CAA prefers languages like Ada and in general seems to
>shy away from OO languages (with the possible exception of the OO
>extensions to Ada).

I agree so we were very surprised to to the US using C++ for the Joint
Strike Fighter. MISRA was asked to do a version of MISRA-C for C++ so we
have.

>I am interested in what these guidelines would have to say though.
>Presumably they will be able to non-MISRA members?

"MISRA members" are the development teams. The standard will be, as
is MISRA-C, available world wide to anyone (for a small charge).

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris Thomasson

unread,
Jun 1, 2008, 5:01:53 AM6/1/08
to
"peter koch larsen" <peter.ko...@gmail.com> wrote in message
news:52af06ca-c3fc-4cd8...@e39g2000hsf.googlegroups.com...
[...]

> This is really to bad: C++ is IMO a better fit than Ada in a lot of
> avionics software. Also, C++ is put to good use in lots of "avionics"
> software - also on board airplanes (one example being the JSF).
> I really would like to hear their argument for this ban.

Yup:

http://www.research.att.com/~bs/JSF-AV-rules.pdf

Chris H

unread,
Jun 1, 2008, 5:04:34 AM6/1/08
to
>On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>> The long awaited MISRA-C++ will be launched on the 5th of June in London
>> at the Safety Critical Systems Club Tools Event.
>>
>> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>>
>> From the 5th of June MISRA-C++ will be available from MISRA
>>
>> Http://www.misra-c.com/index.htm
>
>Just to point out for those not in the know, MISRA stands for The
>Motor Industry Software Reliability Association.

Just to point out for those, like Andrew, who are not in the know.

The MISRA-C standard is used world wide and is use for safety critical
systems not just automotive ones.

In common with MISRA-C the MISRA-C++ team are NOT mainly automotive. And
cover a wide area of disciplines including aerospace, nuclear, rail and
medical.

> Whilst I am sure that
>the motor industry as very concerned about safety there are other

As pointed out MISRA is not specifically Motor Industry It was 15 years
ago but not now.

>organisations that are also concerned and not all of these permit the
>use of C++ no matter how many guidelines there are.

Can't argue with that.

>For example, it is
>not generally permitted by the CAA (the Civil Aviation Authority, in
>the UK). The CAA prefers languages like Ada and in general seems to
>shy away from OO languages (with the possible exception of the OO
>extensions to Ada).

That is up to them... Not saying that C++ is a good language to use BUT
if you must use it then the MISRA-C++ guidelines will help make it
safer.

>I am interested in what these guidelines would have to say though.
>Presumably they will be able to non-MISRA members?

Yes... Of course as are all the other MISRA guides since 1994.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris H

unread,
Jun 1, 2008, 5:57:39 AM6/1/08
to
In message
<52af06ca-c3fc-4cd8...@e39g2000hsf.googlegroups.com>,
peter koch larsen <peter.ko...@gmail.com> writes

>On 30 Maj, 20:27, marlow.and...@googlemail.com wrote:
>> On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>>
>> > The long awaited MISRA-C++ will be launched on the 5th of June in London
>> > at the Safety Critical Systems Club Tools Event.
>>
>> >http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>>
>> > From the 5th of June MISRA-C++ will be available from MISRA
>>
>> > Http://www.misra-c.com/index.htm
>>
>> Just to point out for those not in the know, MISRA stands for The
>> Motor Industry Software Reliability Association. Whilst I am sure that
>> the motor industry as very concerned about safety there are other
>> organisations that are also concerned and not all of these permit the
>> use of C++ no matter how many guidelines there are. For example, it is
>> not generally permitted by the CAA (the Civil Aviation Authority, in
>> the UK).
>
>That must be specific for the UK only. Other places in Europe, C++ is
>quite widespread - and if you just go to Ireland, large parts of their
>software is in C++ (or Ada).

Other parts of the world also use C++......

Now I don't want to start a debate on the pros and cons of using C++ (I
am on record of saying many times MISRA-C++ "over my dead body" which
may explain that whist I am on several MISRA panels I am not on the
MISRA-C++ one) However, MISRA was asked to do a a standard for it as
people were actually using C++.

If people are going to use C++ in critical systems the least we can to
is try and make it safer other than saying

Rule 1: Thou shall use ADA :-)


>> The CAA prefers languages like Ada and in general seems to
>> shy away from OO languages (with the possible exception of the OO
>> extensions to Ada).
>
>This is really to bad:
> C++ is IMO a better fit than Ada in a lot of
>avionics software. Also, C++ is put to good use in lots of "avionics"
>software - also on board airplanes (one example being the JSF).
>I really would like to hear their argument for this ban.


It depends on
The process
The engineers
The language subset
The tools

In a recent article in the Safety Critical Systems Club Journal a few
months ago it argued that the factors above had more effect than the
choice of language.


On the whole (this is a generalisation and I am sure "everyone" will
have anecdotal evidence to the contrary :-) Ada is taught as Software
Engineering in the context of high reliability systems where C++ is
taught as "programming" usually on PC's without an Engineering or high
reliability background.


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris H

unread,
Jun 1, 2008, 8:28:57 PM6/1/08
to
In message <bvudnVlYC_I6mtzV...@comcast.com>, Chris
Thomasson <cri...@comcast.net> writes

>"peter koch larsen" <peter.ko...@gmail.com> wrote in message
>news:52af06ca-c3fc-4cd8...@e39g2000hsf.googlegroups.com...
>[...]
>> This is really to bad: C++ is IMO a better fit than Ada in a lot of
>> avionics software.

Theoretically or in reality? Whilst C++ may theoretically be good it
depends on the equality of the tools, the process and the quality of
the software engineers.


>> Also, C++ is put to good use in lots of "avionics"
>> software - also on board airplanes (one example being the JSF).
>> I really would like to hear their argument for this ban.
>Yup:
>http://www.research.att.com/~bs/JSF-AV-rules.pdf

Amusingly one of the main references for JSF++ is MISRA-C (version 1)

BTW AFAIK there are TWO versions of the JSF++... the one actually used
on the project and the one published.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Francis Glassborow

unread,
Jun 1, 2008, 8:31:46 PM6/1/08
to
jimmaure...@worldnet.att.net wrote:
> The MISRA C++ standard may cause the CAA to re-evaluate their current
> position on C++. Only time will tell. Other C++ subsets have been met
> with varying degrees of acceptance in the C++ community. The EC++
> subset is an example of another attempt to create a subset of C++
> useful for safety-critical applications.
>
I am not aware that safety critical programming was a strong motivator
for EC++. I always understood that it was concerned with the resource
constraints that are normal for many embedded systems.

Chris H

unread,
Jun 1, 2008, 8:30:16 PM6/1/08
to
Hi Mod

In message <9skJd8EE...@phaedsys.demon.co.uk>, Chris H
<ch...@phaedsys.org> writes


>{ Warning: topic drift. This thread is getting little C++ content.
> Please try to stay on topic, or move elsewhere. -mod }

Fair enough... Just wanted to correct the erroneous statements about
MISRA who produced the MISRA-C++ standard. It lost its automotive
and UK bias about a decade ago.

Perhaps I should have included some background notes in the initial
email. I forget that whilst 905 of the C world knows about MISRA the C++
world does not (yet)

Don't want a C++/Ada debate either. That just gets religious :-(
Everyone should be using FORTH :-))))


Regards
Chris

peter koch larsen

unread,
Jun 2, 2008, 11:02:27 PM6/2/08
to
On 31 Maj, 10:06, "Peter C. Chapin" <pcha...@sover.net> wrote:
> peter koch larsen wrote:
> >> The CAA prefers languages like Ada and in general seems to
> >> shy away from OO languages (with the possible exception of the OO
> >> extensions to Ada).
>
> > This is really to bad: C++ is IMO a better fit than Ada in a lot of
> > avionics software.
>
> I'm not saying you are right or wrong, but I am curious about your
> reasons for saying this.

Hi Peter

One place where I would find C++ a better fit is in the handling of
messages. Airtraffic control centers do communicate a lot by
exchanging text-messages (flightplans, meteorological messages and so
on), and interpreting these messages does look (to me) a simpler task
in C++ than in Ada which does not have variable length strings and
does not have a ready framework for parsing. Here something like
Spirit could save a lot of development work and at the same time give
simpler code.
Flightplans also has lots of data giving information such as altitude
and speed, and while the altitude normally is given in feet and the
speed is normally given in nautical miles pr hour, it is also possible
to give these data in other units: as an example, speed can also be
given in km/hour or in mach. I believe that data like this could more
conveniently be handled in C++ using something like a SIUnits
framework.

/Peter

par...@gmail.com

unread,
Jun 3, 2008, 11:36:18 AM6/3/08
to
I would like to clarify some points here, as previously linked "some"
parts of the software "for" the JSF do use C++, but there some very
stringent caveats attached:

1. The majority of onbaord software development is done under a
standard called DO-178B Level A or similar.

2. (1) requires all software be designed/documented/developed in a
very specific manner as such there are no implementations of STL that
are acceptable under those conditions (in-fact the linked report
states that an implementation of STL is currently in progress, but I
haven't seen one for the past 9 years or so)

3. Due to the specific and verbose design requirements from (1) and
(2) some of the more "fancy" metaprogramming solutions to common
problems are not allowed, as such templates are no more than simple
generics in that world

4. Code-coverage is a very big requirement, at the moment there aren't
that many tools (open or commercial) that can provide comprehensive C+
+ oriented code coverage (QAC++ and Greenhills have very expensive
solutions)

5. Certain targets for DO-178B Level A have very peculiar limits on
stack-depth (levels of recursion) and memory usage and atomicity of
certain operations

These are just a few points that shape the way C++ is used in such
environments, the sad thing is at the end of the day some feel that
they're not using C++ anymore....

Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net

On Jun 2, 10:28 am, Chris H <ch...@phaedsys.org> wrote:
> In message <bvudnVlYC_I6mtzVnZ2dnUVZ_uqdn...@comcast.com>, Chris
> Thomasson <cris...@comcast.net> writes
>
> >"peter koch larsen" <peter.koch.lar...@gmail.com> wrote in message


> >news:52af06ca-c3fc-4cd8...@e39g2000hsf.googlegroups.com...
> >[...]
> >> This is really to bad: C++ is IMO a better fit than Ada in a lot of
> >> avionics software.
>
> Theoretically or in reality? Whilst C++ may theoretically be good it
> depends on the equality of the tools, the process and the quality of
> the software engineers.
>
> >> Also, C++ is put to good use in lots of "avionics"
> >> software - also on board airplanes (one example being the JSF).
> >> I really would like to hear their argument for this ban.
> >Yup:
> >http://www.research.att.com/~bs/JSF-AV-rules.pdf
>
> Amusingly one of the main references for JSF++ is MISRA-C (version 1)
>
> BTW AFAIK there are TWO versions of the JSF++... the one actually used
> on the project and the one published.
>

--

Maciej Sobczak

unread,
Jun 3, 2008, 12:03:53 PM6/3/08
to
{ please consider in future posting to this thread that discussing
advantages and drawbacks of other languages belongs to the forums
specifically dedicated to those languages. thank you. -mod }

On 3 Cze, 05:02, peter koch larsen <peter.koch.lar...@gmail.com>
wrote:

> One place where I would find C++ a better fit is in the handling of
> messages. Airtraffic control centers do communicate a lot by
> exchanging text-messages (flightplans, meteorological messages and so
> on), and interpreting these messages does look (to me) a simpler task
> in C++ than in Ada which does not have variable length strings

This is incorrect. Ada does have a variable-length strings, very
similar in concept (and implementation) to our std::string. The
relevant package is named Ada.Strings.Unbounded.

Note also that the standard String type in Ada allows to work with
strings which length is determined at run-time, but without involving
heap allocation. *This* is very attractive (more than std::string),
*especially* for critical software, where in some cases the heap is
simply forbidden. If you realize the implication of this (hint: how
would you work with strings in C++ without heap?), you will see that
string handling is actually a strong feature of Ada.

> and
> does not have a ready framework for parsing.

This is incorrect. Ada does have frameworks for parsing, see for
example GNAT.Spitbol.

> Flightplans also has lots of data giving information such as altitude
> and speed, and while the altitude normally is given in feet and the
> speed is normally given in nautical miles pr hour, it is also possible
> to give these data in other units: as an example, speed can also be
> given in km/hour or in mach. I believe that data like this could more
> conveniently be handled in C++ using something like a SIUnits
> framework.

It is certainly possible to build such a solution for Ada (if it does
not exist already) and when it comes to units and domain separation,
Ada provides more complete solutions out of the box.

I don't claim that you are wrong in your statement about C++ vs. Ada
for critical software, but certainly the arguments you have provided
do not support it. You can expect some Ada experts jumping on you
pretty soon.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

peter koch larsen

unread,
Jun 3, 2008, 4:26:09 PM6/3/08
to
On 3 Jun., 18:03, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> { please consider in future posting to this thread that discussing
> advantages and drawbacks of other languages belongs to the forums
> specifically dedicated to those languages. thank you. -mod }
>
> On 3 Cze, 05:02, peter koch larsen <peter.koch.lar...@gmail.com>
> wrote:
>
> > One place where I would find C++ a better fit is in the handling of
> > messages. Airtraffic control centers do communicate a lot by
> > exchanging text-messages (flightplans, meteorological messages and so
> > on), and interpreting these messages does look (to me) a simpler task
> > in C++ than in Ada which does not have variable length strings
>
> This is incorrect. Ada does have a variable-length strings, very
> similar in concept (and implementation) to our std::string. The
> relevant package is named Ada.Strings.Unbounded.

Thank you. I already have been told that. I was not aware of that
package - is it in the orginal Ada specification?

>
> Note also that the standard String type in Ada allows to work with
> strings which length is determined at run-time, but without involving
> heap allocation. *This* is very attractive (more than std::string),
> *especially* for critical software, where in some cases the heap is
> simply forbidden. If you realize the implication of this (hint: how
> would you work with strings in C++ without heap?), you will see that
> string handling is actually a strong feature of Ada.

I know that. I know that such a library was suggested for boost but
not accepted. Anyway, writing such a class is not a big problem (I
have written such a class myself - not to avoid the allocation but
that is a side-effect, of course), so I can't see the big advantage.

>
> > and
> > does not have a ready framework for parsing.
>
> This is incorrect. Ada does have frameworks for parsing, see for
> example GNAT.Spitbol.

I did not know that package either: presumably my Ada knowledge is out
of date. The documentation I found did seem to indicate that Spitbol
is more like a regular expression library, but I'll try to find time
give it a closer look,


>
> > Flightplans also has lots of data giving information such as altitude
> > and speed, and while the altitude normally is given in feet and the
> > speed is normally given in nautical miles pr hour, it is also possible
> > to give these data in other units: as an example, speed can also be
> > given in km/hour or in mach. I believe that data like this could more
> > conveniently be handled in C++ using something like a SIUnits
> > framework.
>
> It is certainly possible to build such a solution for Ada (if it does
> not exist already) and when it comes to units and domain separation,
> Ada provides more complete solutions out of the box.

The problem with Ada is that it is a bit more difficult to use the
generic classes. You must specify the usage explicitly, so if you
divide a length with a time, you will have to explicitly specify the
velocity.

>
> I don't claim that you are wrong in your statement about C++ vs. Ada
> for critical software, but certainly the arguments you have provided
> do not support it. You can expect some Ada experts jumping on you
> pretty soon.

Well... they already had. Thank you for that: it is not to late to
learn new stuff ;-)

Peter

Chris Thomasson

unread,
Jun 3, 2008, 4:26:34 PM6/3/08
to
"Maciej Sobczak" <see.my....@gmail.com> wrote in message
news:785d2f4d-272c-4aa3...@z66g2000hsc.googlegroups.com...

>{ please consider in future posting to this thread that discussing
> advantages and drawbacks of other languages belongs to the forums
> specifically dedicated to those languages. thank you. -mod }
>
> On 3 Cze, 05:02, peter koch larsen <peter.koch.lar...@gmail.com>
> wrote:
>
>> One place where I would find C++ a better fit is in the handling of
>> messages. Airtraffic control centers do communicate a lot by
>> exchanging text-messages (flightplans, meteorological messages and so
>> on), and interpreting these messages does look (to me) a simpler task
>> in C++ than in Ada which does not have variable length strings
>
> This is incorrect. Ada does have a variable-length strings, very
> similar in concept (and implementation) to our std::string. The
> relevant package is named Ada.Strings.Unbounded.
>
> Note also that the standard String type in Ada allows to work with
> strings which length is determined at run-time, but without involving
> heap allocation. *This* is very attractive (more than std::string),
> *especially* for critical software, where in some cases the heap is
> simply forbidden. If you realize the implication of this (hint: how
> would you work with strings in C++ without heap?),

You create a stack based allocator and make the string template use it
instead of std::allocator. I had to work with a platform which did not have
a heap (e.g., ARM9 on old version of Quadros). However, a Quadros task did
have some stack space. So, I created a full blown heap using a portion of a
plurality of tasks stack space...


> you will see that
> string handling is actually a strong feature of Ada.

[...]

Maciej Sobczak

unread,
Jun 3, 2008, 10:34:43 PM6/3/08
to
On 3 Cze, 22:26, peter koch larsen <peter.koch.lar...@gmail.com>
wrote:

(I will try to stay on-topic)

> > Ada does have a variable-length strings, very
> > similar in concept (and implementation) to our std::string. The
> > relevant package is named Ada.Strings.Unbounded.
>
> Thank you. I already have been told that. I was not aware of that
> package - is it in the orginal Ada specification?

Yes, for Ada 2005 (most recent revision), but please move to
comp.lang.ada for more details.

> > (hint: how
> > would you work with strings in C++ without heap?)

> I know that such a library was suggested for boost but


> not accepted. Anyway, writing such a class is not a big problem (I
> have written such a class myself - not to avoid the allocation but
> that is a side-effect, of course), so I can't see the big advantage.

The advantage is that your class is not widely known and therefore
needs learning. In addition, in more constrained environments (we are
talking about critical software here), such a class might be forbidden
for various reasons, which are not always rational.
Standard and out-of-the-box features do not suffer from these
problems.

> > > I believe that data like this could more
> > > conveniently be handled in C++ using something like a SIUnits
> > > framework.
>
> > It is certainly possible to build such a solution for Ada (if it does
> > not exist already)

> The problem with Ada is that it is a bit more difficult to use the
> generic classes.

Frankly speaking, I'm not sure if generics (or templates) are the best
tool to do the job. I would probably go with straight operator
overloading and code generators - also for C++. The advantage of this
approach is best seen when reading compiler errors or debugging.

You might want to have a look at this:

http://www.msobczak.com/prog/typegen/

I prefer this solution (or anything following this scheme) over any
number of template-based tricks. The reasons are explained at the
beginning of the page.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

[ See http://www.gotw.ca/resources/clcm.htm for info about ]

marlow...@googlemail.com

unread,
Jun 6, 2008, 12:27:42 PM6/6/08
to
On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
> Hi
>
> The long awaited MISRA-C++ will be launched on the 5th of June in London
> at the Safety Critical Systems Club Tools Event.
>
> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>
> From the 5th of June MISRA-C++ will be available from MISRA
>
> Http://www.misra-c.com/index.htm

Is the link to the C++ site working? Is the C++ site working? When I
tried to access it it was as slow as a dog with no legs stuck in a
pool of tar on a cold winter's morning.

-Andrew Marlow

--

Chris H

unread,
Jun 8, 2008, 5:35:18 PM6/8/08
to
In message
<d3615a5e-c654-4749...@8g2000hse.googlegroups.com>,
marlow...@googlemail.com writes

>On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>> Hi
>>
>> The long awaited MISRA-C++ will be launched on the 5th of June in London
>> at the Safety Critical Systems Club Tools Event.
>>
>> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>>
>> From the 5th of June MISRA-C++ will be available from MISRA
>>
>> Http://www.misra-c.com/index.htm
>
>Is the link to the C++ site working? Is the C++ site working? When I
>tried to access it it was as slow as a dog with no legs stuck in a
>pool of tar on a cold winter's morning.

Try

http://www.misra-c.com/forum/index.php


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris H

unread,
Jun 9, 2008, 2:21:37 PM6/9/08
to
In message <J$l0JkNKR...@phaedsys.demon.co.uk>, Chris H
<ch...@phaedsys.org> writes

>In message
><d3615a5e-c654-4749...@8g2000hse.googlegroups.com>,
>marlow...@googlemail.com writes
>>On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>>> Hi
>>>
>>> The long awaited MISRA-C++ will be launched on the 5th of June in London
>>> at the Safety Critical Systems Club Tools Event.
>>>
>>> http://www.safety-club.org.uk/diary.html?opt=detail&id=70
>>>
>>> From the 5th of June MISRA-C++ will be available from MISRA
>>>
>>> Http://www.misra-c.com/index.htm

It should be working now

marlow...@googlemail.com

unread,
Jun 12, 2008, 7:57:13 AM6/12/08
to
On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:

> Http://www.misra-c.com/forum/index.php

The link is working now, at last. I would like to point out that as
with several stds, there is a charge, just like ISO charge for a copy
of the C++ std. The link is: http://www.misra-cpp.org/buy.htm.

Regards,

Andrew Marlow

--

Chris H

unread,
Jun 12, 2008, 9:30:22 PM6/12/08
to
In message
<1e54ed1b-8293-4fd1...@34g2000hsf.googlegroups.com>,
marlow...@googlemail.com writes

>On 28 May, 17:40, Chris H <ch...@phaedsys.org> wrote:
>
>> Http://www.misra-c.com/forum/index.php
>
>The link is working now, at last. I would like to point out that as
>with several stds, there is a charge, just like ISO charge for a copy
>of the C++ std. The link is: http://www.misra-cpp.org/buy.htm.

Some one has to pay for all the work.


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

0 new messages