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-Thread: 103376,c469fdacc2f3302b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Dynamic Variant Record Creation Date: Tue, 16 Mar 2010 16:40:20 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1268772006 749 192.74.137.71 (16 Mar 2010 20:40:06 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 16 Mar 2010 20:40:06 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:3zKTQ0BBZ/ApT5YDPJqRzlkMpdk= Xref: g2news1.google.com comp.lang.ada:9608 Date: 2010-03-16T16:40:20-04:00 List-Id: 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. There's a rich variety of features to suppress warnings on a fine-grained or coarse-grained basis. See the docs. 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). 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. In fact, I'd go so far as to say a compiler that gives warnings (some of which are false alarms) is broken if it doesn't support some way to suppress them. Warning: pragma Warnings is GNAT specific. But that's OK; it won't harm portability. - Bob