diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-03-08 12:19:11 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-03-08 12:19:11 +0000 |
commit | 8602a4fb0b20a882ce00c7b148b04d54b14521fc (patch) | |
tree | c8f99f9cca7cca7e1fb128ae6fc4ef1681b8bcb0 /doc | |
parent | dacd9a5c131a56fcc619fa1b70392e90035a1a06 (diff) | |
download | mpfr-8602a4fb0b20a882ce00c7b148b04d54b14521fc.tar.gz |
Clarification about the custom interface and macros.
* doc/mpfr.texi: added some text in Section "Custom Interface".
* src/mpfr.h: replaced the remaining FIXME by another comment.
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14462 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc')
-rw-r--r-- | doc/mpfr.texi | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/mpfr.texi b/doc/mpfr.texi index 424997714..2622b1c4b 100644 --- a/doc/mpfr.texi +++ b/doc/mpfr.texi @@ -3902,6 +3902,12 @@ to the application. Each function in this interface is also implemented as a macro for efficiency reasons: for example @code{mpfr_custom_init (s, p)} uses the macro, while @code{(mpfr_custom_init) (s, p)} uses the function. +Note that the macro may evaluate arguments multiple times (or none). +Moreover, macros implementing functions with the @code{void} return type +may not be used in contexts where an expression is expected, e.g., inside +@code{for(...)} or before a comma operator. +@c These limitations with macros cannot be avoided in a C90 compatible way. +@c In the future, inline functions could be used. Note 1: MPFR functions may still initialize temporary floating-point numbers using @code{mpfr_init} and similar functions. See Custom Allocation (GNU MP)@. |