C99 and GMP

Niels Möller nisse at lysator.liu.se
Wed Apr 4 07:00:22 UTC 2018

tg at gmplib.org (Torbjörn Granlund) writes:

> I'd like to move to C99 soon.

Nice. Any particular C99 features you'd like to use? Some of the
features (from the list on https://en.wikipedia.org/wiki/C99):

* Better floating point support (e.g., standardized float.h).

* Standard inline (with semantics different from what older gcc did).

* Variable length arrays, which could replace some or all use of alloca
  (but this was demoted to an optional language feature in C11, so maybe
  not portable enough).

* Mid-block declarations.

* New types stdint.h, stdbool.h, complex.h. I imagine that changing int
  to bool where appropriate in the public functions would be an ABI
  break, though. New functions with intmax_t arguments may be useful (as
  discussed earlier), even if the concept of "intmax_t" will likely
  break over time in the same way as "long", which originally meant
  about the same thing.

* snprintf and vsnprintf now in the standard library.

* Standard variadic macros.

* restrict keyword (which we already use on compilers supporting it,

* C++ style // comments 
> I'd suggest to make a 6.2 release of pretty much what we have today.

Sounds good to me. Looking through my entries in ChangeLog, most
interesting change was the merge of my changes (originating several
years ago) to change the conventions for what bdiv functions compute.

And a few bug-fixes in mini-gmp/ChangeLog.


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list