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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,29c1212970bb6877 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Per Sandberg Newsgroups: comp.lang.ada Subject: Re: String Pointer Bug Date: Thu, 04 Nov 2004 07:18:35 +0100 Organization: Cuivre, Argent, Or Message-ID: References: <35f054ea.0411021132.6b03488@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1099549167 28285 212.85.156.195 (4 Nov 2004 06:19:27 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 4 Nov 2004 06:19:27 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: skidmarks Return-Path: User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en In-Reply-To: <35f054ea.0411021132.6b03488@posting.google.com> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:5985 Date: 2004-11-04T07:18:35+01:00 Running GNAT Pro 5.03w (20041005-34)/ gcc-3.4.3 i get exactly the same messages as "compiler" /Per skidmarks wrote: >(Program below): The same code fragment was run on two different >compilers, GNAT and another commercial vendor, 'compiler. The results >are inconsistent and I don't believe that both sets of errors can be >correct. Before I scream and holler, I wonder if there are wiser heads >who can provide insight into which (if any) compiler version is >incorrect. > >The summary is that a pointer to a definite type and a pointer to an >indefinite typed value have different constraints, detected and >reported. I would assume that compliant compilers would complain >similarly. > >Thanks > >art >------------------------------ C O D E ------------------------------ > >procedure Bug is > > type String_Ptr is access all String; > > subtype Str_Ptr is String_Ptr( 1 .. 12 ); > > type String_Array is array( 1 .. 68 ) of aliased String( 1 .. 12 >); > > Input : String_Array := ( others => (others => ' ') ); > StrArray : array( 1 .. 68 ) of aliased String( 1 .. 12 ); > Strng : aliased String := "one two three"; > -- GNAT warning not issued by Compiler > -- >>> warning: aliased object has explicit bounds > -- >>> warning: declare without bounds (and with explicit >initialization) > -- >>> warning: for use with unconstrained access > Str : String_Ptr; > Str_Def : Str_Ptr; > > -- Compiler Diagnostic Message > -- LRM:3.10.2(27) The nominal subtype of the prefix to 'ACCESS or > -- 'UNCHECKED_ACCESS must either statically match > -- the expected type or the designated subtype must >be > -- discriminated and unconstrained > > -- GNAT (gcc-3.3.1 & gcc-3.3.3) > -- object subtype must statically match designated subtype > > -- Error Messages (See above) >begin -- Bug GNAT COMPILER > Str := Input(1)'Access; -- X X > Str := StrArray(1)'Access; -- X X > Str := Strng'Access; > > Str_Def := Input(1)'Access; -- X > Str_Def := StrArray(1)'Access; -- X > Str_Def := Strng'Access; -- X >end Bug; >_______________________________________________ >comp.lang.ada mailing list >comp.lang.ada@ada-france.org >http://www.ada-france.org/mailman/listinfo/comp.lang.ada > > >