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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1ce307c10055549 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-12 10:26:43 PST Message-ID: <3DF8D46C.1040404@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: IBM Acquires Rational Ada References: <3DF1615C.7AAAC86E@adaworks.com> <3DF1B042.6603DDDE@easystreet.com> <3DF2A483.EC512CDF@adaworks.com> <8db3d6c8.0212091445.12594821@posting.google.com> <3DF628C4.7090607@cogeco.ca> <3DF6653D.3030603@cogeco.ca> <8db3d6c8.0212101850.51506572@posting.google.com> <1039618741.173427@master.nyc.kbcfp.com> <8db3d6c8.0212111251.1ecca62e@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Dec 2002 13:24:44 -0500 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1039717485 198.96.47.195 (Thu, 12 Dec 2002 13:24:45 EST) NNTP-Posting-Date: Thu, 12 Dec 2002 13:24:45 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:31759 Date: 2002-12-12T13:24:44-05:00 List-Id: Here's another one ;-) main(){ short i = -32768; short j; j = -i; } The results are implementation specific (although that may have changed with C99 -- I stopped caring after I got into Ada ;-) I have seen j=0 in my travels, but don't count on it. Warren. steve_H wrote: > Hyman Rosen wrote in message news:<1039618741.173427@master.nyc.kbcfp.com>... > > >>I think it's a >>fallacy cherished by Ada programmers that C or C++ will >>just accept any garbage, and therefore code can just be >>churned out in those languages. > > > Oh but it does accept any garbage. > > Are you say that C will not accept this code > > ----------------------- > main(){ > long j=999999999; > short i; > > i=j; > } > ---------------- > > ?? > > Ok, lets find out: > > $ cat foo.c > main(){ > long j=999999999; > short i; > i=j; > } > > $ gcc foo.c -o foo > $ ./foo > > it worked!! It compiled with no erros, and ran with no errors. > > I wonder how the compiler managed to stuff 999,999,999 into a short > variable? special packing algorithm must be :) > > If the above is not garbage, then what do you call it? Brilliancy? > > And on top of them, people will actually choose C and C++ for numerical > computation instead of Ada. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg