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,FREEMAIL_FROM, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9ce095aba33fe8d0,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Luke" Newsgroups: comp.lang.ada Subject: Negative float problem Date: 26 Oct 2005 11:32:54 -0700 Organization: http://groups.google.com Message-ID: <1130351574.313991.229420@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 80.195.169.252 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1130351581 24473 127.0.0.1 (26 Oct 2005 18:33:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 26 Oct 2005 18:33:01 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=80.195.169.252; posting-account=9JQ8lw0AAACrrtpfrKMmiO20uQ7lPzTe Xref: g2news1.google.com comp.lang.ada:5962 Date: 2005-10-26T11:32:54-07:00 List-Id: Hi If I have two files: file1: package file1 is type My_Float is digits 6; end file1; and file2: with file1; procedure file2 is X : file1.My_Float := -1.0; begin X := 1.0; end file2; and do gnatmake file2.adb i get the following error: file2.adb:4:31: operator for type "My_Float" defined at file1.ads:3 is not directly visible file2.adb:4:31: use clause would make operation legal There are two solutions: 1) add a use type as sugested 2) Change line 4 to: X : file1.My_Float := file1.My_Float(-1.0); If 2 works then why doesnt the original? The same is true for +1.0. Is this a fault with gcc? gcc -v gives: Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux Thread model: posix gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)