GMP crashes when using gmp_scanf to scan an mpf_t.

Vincent Lefevre vincent at vinc17.net
Thu Aug 24 15:40:31 UTC 2017


On 2017-08-24 17:32:26 +0200, Marc Glisse wrote:
> On Thu, 24 Aug 2017, Piotr Olszewski wrote:
> 
> > The crash happened when I tried to run a piece of code from the
> > manual (11.1):
> > 
> > /* to read say "topleft (1.55,-2.66)" */
> > mpf_t x, y;
> > char buf[32];
> > gmp_scanf ("%31s (%Ff,%Ff)", buf, x, y);
[...]
> This is not a snippet meant to be copy-pasted, the declarations are
> there to show the types of the arguments, but you need to mpf_init
> the variables as usual.

It would be clearer if the manual had something like

  /* init, etc. */

between the declarations and the gmp_scanf.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list