Richard Heathfield
12/31/2015 6:59:00 PM
On 31/12/15 18:50, Ramine wrote:
>
> 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,
Well, okay, we can play ad hominem if you like. You think my argument is
stupid, and I think your articles - your incessant, boring,
ill-conceived, badly-written articles - are stupid. So what?
> 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
What has that to do with it? In C and C++, unsigned integer arithmetic
is performed modulo 2^(CHAR_BIT * sizeof(unsigned_type)). That's not a
weakness. That's a feature, and a very useful feature. If you don't like
it, don't use C or C++. But to say that they are not suitable for
such-and-such a purpose just because they contain a feature you don't
like is utterly preposterous.
> 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.
Using the same logic, Pascal incorrectly uses the semicolon as a
separator rather than as a terminator, and therefore Pascal is not
suitable for realtime safety critical systems. *That* is a stupid
argument, and it's identical in form to your own.
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within