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,74e0716429aeb760 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-10 10:12:19 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newspeer.radix.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: simple question just to be sure X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BC478E3.C269C992@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Wed, 10 Oct 2001 16:35:47 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:14179 Date: 2001-10-10T16:35:47+00:00 List-Id: Rammeloo Stijn wrote: > > Hello, > > According to me the following constructs are equivalent and are both > perfectly legal ada in ada83 and ada95: > > Bad_Frame_Name : constant String (1 .. 4) := "Bad" & Ascii.Nul; > > A_Nul : constant Character:= Ascii.Nul; > Bad_Frame_Name : constant String (1 .. 4) := "Bad" & A_Nul; > > Why do I ask? We use a code analyses tool that stumbles over the first > construct with the error message "Bad_Frame_Name Value length 5 does not > match object length 4" but not over the second one. According to me this is > clearly a bug in the code analyses tool. According to the vendor, this 'odd' > behaviour would be caused by the fact that the first construct 'May not be > "perfect" Ada' but the second is. I totaly disagree with this statement. Can > some ada-guru out there confirm I'm right or, if not, why I'm wrong? This appears to be an error in the analysis tool. Both expressions are legal and equivalent. However, Name : constant String := "Whatever" & ASCII.NUL; is better for minimizing future errors when the software changes, and should work around the analysis tool error as well. -- Jeffrey Carter