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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ecc38b3271b36b88 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: What is the warning about builtin-function on gcc-4.6.0 ? Date: Sat, 26 Mar 2011 22:22:08 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: anon@anon.org NNTP-Posting-Host: zCJWntAPxvF7nIXw0aTMsw.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news1.google.com comp.lang.ada:18486 Date: 2011-03-26T22:22:08+00:00 List-Id: In , ytomino writes: >Hello. >gcc-4.6.0 was released! >I'm trying to compile my code with gcc-4.6.0, >and I found a strange warning at using built-in functions of gcc. > >The minimal code is here: > >with Ada.Text_IO; >procedure test1 is > function isfinite (X : Long_Float) return Integer; > pragma Import (Intrinsic, isfinite, "__builtin_isfinite"); >begin > -- 10 is finite value, it puts 1 > Ada.Text_IO.Put_Line (Integer'Image ( > isfinite (Long_Float'Value ("10")))); > -- 10 / 0 is infinite, it puts 0 > Ada.Text_IO.Put_Line (Integer'Image ( > isfinite (Long_Float'Value ("10") / Long_Float'Value ("0")))); >end test1; > >$ /usr/local/bin/gcc-4.5.2/gnatmake test1 >gcc -c test1.adb >gnatbind -x test1.ali >gnatlink test1.ali >~/projects/exam/ada/compiler/builtin >$ /usr/local/bin/gcc-4.6.0/gnatmake test1 >gcc -c test1.adb >test1.adb:3:13: warning: profile of "isfinite" doesn't match the >builtin it binds <- this warning >gnatbind -x test1.ali >gnatlink test1.ali > >I tried changing the prototype again and again, > > function isfinite (X : Long_Float) return Integer; > function isfinite (X : Long_Float) return Boolean; > function isfinite (X : Float) return Integer; > function isfinite (X : Long_Long_Float) return Integer; > ...etc... > >but I could not erase this warning... Can anyone erase this warning ? > >Thank you. > >-- >Yuta Tomino Try replacing with pragma Import (Intrinsic, isfinite, "__builtin_isfinite"); with pragma Import (C, isfinite, "__builtin_isfinite");