[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming.threads

My answer about Ada and FreePascal and C++

Ramine

12/31/2015 6:50:00 PM

I wrote:

> The following is true in C++:
>
> 1. C/C++ provide implicit type conversions between signed and unsigned
> values. Unlike Ada, there is no a runtime check to make sure the value
> is convertible to the new type. For example, you can readily â??convertâ? a
> negative signed value to an unsigned value.


And Richard Heathfield answered:

--

That's perfectly true. For example:

unsigned long maxval = -1;

That's a good thing, not a bad thing.

---


I think Richard Heathfield that your argument about C++ is stupid,
because in FreePascal you have it both ways, you can have it
the way of C++ if you don`t compile with the -Cr compiler option
and you can have it the Ada way if you compile it with the FreePascal
compiler -Cr option, the FreePascal -Cr compiler option is suitable
for realtime safety critical systems where you have to constrain
the system with an unsigned int and you want at runtime to catch
the exception locally in the function or you want to catch the
exception globally, that`s what you can do in FreePascal and Ada, but
you can not do it in C and C++ , so C++ and C are not suitable
for realtime safety critical systems.



Thank you,
Amine Moulay Ramdane.