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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c469fdacc2f3302b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Dynamic Variant Record Creation Date: Tue, 16 Mar 2010 20:44:51 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Tue, 16 Mar 2010 20:44:51 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="11142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sXS+cdy0ZtxMIDRwOxKnrwcK/BgkOrzY=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:Ms7h6wN86R2hV0D7EL3MFtOXNlw= Xref: g2news2.google.com comp.lang.ada:10580 Date: 2010-03-16T20:44:51+00:00 List-Id: Robert A Duff expounded in news:wcchbogngp7.fsf@shell01.TheWorld.com: > Warren writes: >> *.adb:327:13: warning: variable "Result" is read but never assigned >> Perhaps a dummy assignment after I am through with it >> would be enough. Is there a better way of dealing with >> the warning? > > When a warning is a false alarm, I think the appropriate way to > deal with it is to use pragma Warnings. I'll dig that up tonight. > But first make sure you really believe it is a false alarm, > and then put in a comment explaining why. (Sounds like > in this case, it's OK because you have no components > besides the discriminant). Yep, in this specific case, anyway. > Contorting the code (e.g. inserting a dummy assignment) is > rarely the way to go. Neither is it a good idea to simply > ignore them -- you should be able to have a clean (warning-free) > build. Agreed. > Warning: pragma Warnings is GNAT specific. But that's OK; > it won't harm portability. > > - Bob That's ok-- the project is skewed to gnat anyway. Thanks, Warren