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=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: -fdump-ada-spec (was: Newcomers to comp.lang.ada: welcome and how did you end up here ?) Date: Wed, 08 Oct 2014 21:14:34 +0200 Organization: A noiseless patient Spider Message-ID: <8761fu8jc5.fsf_-_@ludovic-brenta.org> References: <20141007101042.08f99687@atmarama.ddns.net> <1028866756434371637.714832laguest-archeia.com@nntp.aioe.org> <20141008092318.18ca2ecd@atmarama.ddns.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="d28ff35b9b1b040cf8923953aa0038d8"; logging-data="27750"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uRFqeetibJ7p6qOmeEWMK" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:JoqbH8jj1+qVn2Kts70pmzShPeA= sha1:f6IRll0Mht/Ig0DKCVCsHga3yaI= Xref: number.nntp.giganews.com comp.lang.ada:189558 Date: 2014-10-08T21:14:34+02:00 List-Id: > Apparently one should use g++ rather than gcc, because it makes a better > job of it. > > GNAT GPL 2014 does translate (some) macros; it doesn't always get it > right, eg > > #define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ > #define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ > #define MAXFLOAT 0x1.fffffep+127f > > // have to have _something_ besides the constants or no .ads gets > // generated. > extern float sinf(float); > > turns into > > pragma Ada_2005; > pragma Style_Checks (Off); > > with Interfaces.C; use Interfaces.C; > > package math_h is > > > M_SQRT2 : constant := 1.41421356237309504880168872420969808; -- ./math.h:1 > M_SQRT1_2 : constant := 8#.707106781186547524400844362104849039#; -- ./math.h:2 ^^ ^ Isn't that a blatant bug? Either in the Ada or in the C source? -- Ludovic Brenta.