From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me
X-Spam-Level: **
X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_00,INVALID_MSGID,
MSGID_RANDY,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no
version=3.4.4
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 109fba,98ad5b2a2cd88a53
X-Google-Attributes: gid109fba,public
X-Google-Thread: 103376,98ad5b2a2cd88a53
X-Google-Attributes: gid103376,public
From: "Pascal Obry"
Subject: Re: Ada or C++ acting 'correctly' here?
Date: 1999/03/02
Message-ID: <7bg7pi$fgf$1@cf01.edf.fr>#1/1
X-Deja-AN: 450289919
References: <7b8c7u$sj1@drn.newsguy.com> <7bg0pc$5a4$1@ffx2nh3.news.uu.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: EDF
Newsgroups: comp.lang.ada,comp.lang.c++
Date: 1999-03-02T00:00:00+00:00
List-Id:
Willliam V a �crit dans le message <7bg0pc$5a4$1@ffx2nh3.news.uu.net>...
>500000000*7 is a negative quantity. C++ prints out
>what you ask it to do.
>try unsigned long l = 500000000*7;
>cout << l;
>or even
>cout << ((unsigned long )500000000)*7);
>If Linux 'd make the unsigned long to be 64 bit, you Ada would
>have compiled fine. So the Ada compiler you are using is
>relying very heavily on the underlying C machinery. Don't be
>too fast to blame C or C++
Certainly not. What does it means anyway that "your Ada compiler is
relying on the underlying C machinery" ????
It is just that the Ada compiler rely on the underlying architecture, how
could it be otherwise anyway !
The 32 bits or 64 bits attributes are coming from the architecture not
from the C compiler. So the only thing we know now is that a machine
word (in this example) is 32 bits.
And now again, Ada pay attention to that but C/C++ does not.
Pascal.