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=0.1 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ecb5248e650e812 X-Google-Attributes: gid103376,public From: Wes Groleau Subject: Re: Ada and robots Date: 1997/06/27 Message-ID: <33B3E157.34D9@does.not.exist.com>#1/1 X-Deja-AN: 252997732 Sender: usenet@most.fw.hac.com (News Administration) X-Nntp-Posting-Host: sparc02 References: <9706262213.AA13647@stealth.ctron.com> Organization: See Warning Below! Newsgroups: comp.lang.ada Date: 1997-06-27T00:00:00+00:00 List-Id: Huy Vo wrote: > > jsa@alexandria.organon.com (Jon S Anthony) wrote: > > >In article <9706242128.AA09652@stealth.ctron.com> Huy Vo writes: > > > >> >a) No one is dumb enough to suggest Ada programs are by nature some > >> >how bug free. So, you are just giving a silly strawman > >> > >> Cool; Ada is not as safe as I thought it was; so, when I board a Boeing > >> I should think twice. > > > >Whatever floats your boat. > > > > > >> As a C programmer, I know it better than anyone; so I have been > >> religiously checking every malloc()'s return and proceed > >> accordingly. What do you do when you call new and new fails? > > > Someone has to care, Jon. Because if you dynamically allocate memory > at 101 places in your 100K lines of code and only one of > the allocations failed, you really want to know which one failed. > As an application programmer what would you do? As a compiler writer > that has to provide a default handler for this type of situation > what would you do? > > In C, it's as simple as > > if (!(cp =malloc(BIG_CHUNK)) { > fprintf(stderr, "Buy some more ram, i died at line %d\n", __LINE__); > exit(1); > } > > Show me your code. I don't have time to show you my code. But I am not about to put such a Put_Line at a hundred and one places in the code (though it is possible in combination with SCCS and an exception handler). Neither would I allow my customer to see such a message if I could prevent it. I just tell the debugger to break on Storage_Error and if it happens, show stack. (Better yet, have a stack trace in Ada.Exceptions.Exception_Information--but that thread is still in progress...) -- ---------------------------------------------------------------------- Wes Groleau, Hughes Defense Communications, Fort Wayne, IN USA Senior Software Engineer - AFATDS Tool-smith Wanna-be wwgrol AT pseserv3.fw.hac.com Don't send advertisements to this domain unless asked! All disk space on fw.hac.com hosts belongs to either Hughes Defense Communications or the United States government. Using email to store YOUR advertising on them is trespassing! ----------------------------------------------------------------------