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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Introductory Presentations, especially aimed at C++ programmers! Date: Fri, 9 Dec 2016 16:15:45 -0600 Organization: JSA Research & Innovation Message-ID: References: <1905815374.502825168.454102.laguest-archeia.com@nntp.aioe.org> <87y3zq4t05.fsf@nightsong.com> <0ad2eb12-421f-4159-8df2-5bf7e0dddf06@googlegroups.com> <87mvg551pi.fsf@nightsong.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1481321746 19563 24.196.82.226 (9 Dec 2016 22:15:46 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 9 Dec 2016 22:15:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:32706 Date: 2016-12-09T16:15:45-06:00 List-Id: "G.B." wrote in message news:o2dq9o$37c$1@dont-email.me... ... > (I'm curious about the specifics in this example, since, e.g., > RegQueryValueEx has a usage protocol associated with it and > seems to not produce an overflow of the BYTE far* buffer.) The specific case is a call to the Claw procedure Claw.Registry.Get, which takes an String and Last value much like Text_IO.Get_Line. This routine raises an exception if the result doesn't fit, as the output buffer has fixed bounds. One could imagine a Claw.Registry.Get that took an Unbounded_String, which would be able to avoid the overflow problem, but we didn't include one in the Claw package. I believe that is because doing so (throughout Claw) would force Ada.Strings.Unbounded to be loaded as part of every Claw program, and that seemed like a large enough package that we didn't want that. There is a way to recover from the Overflow_Error raised by Claw.Registry.Get, but I only found that out examining the code yesterday -- I didn't use that mechanism in either the installer or uninstaller, or any other Claw program that I've written, either. (Most of the others are tying a GUI to the registry key, and the GUI enforces a maximum length, so there isn't as much need.) Randy. Randy.