Skip to content

Commit

Permalink
add point on variadic macros
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87152 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Sep 15, 2024
1 parent 0373f55 commit cbdc93e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/manual/R-exts.texi
Original file line number Diff line number Diff line change
Expand Up @@ -6373,7 +6373,7 @@ something like
error("Actual: %0.f; Expected %0.f\n", (double) XLENGTH(Robj), (double) nelem);
@end example
@noindent
@c x86_64 as a 52-bit design limit.
@c x86_64 has a 52-bit design limit.
@c Linux and Windows are said to have 48-bit virtual address limits.
(This could print to full precision, lengths well beyond the address space
limits of current OSes, let alone practical limits.)
Expand All @@ -6389,6 +6389,12 @@ as @code{int64_t}.
So the values will need to be cast to the type assumed by the format
(and @code{%lld} was not supported on Windows until @R{}@tie{}4.2.0).

@item
Variadic macros in C or C++ only portably allow a non-zero number of
arguments, although some compilers have allowed zero, often with a
warning. The latter was standardized in C++20 using the @code{__VA_OPT__}
maacro. C23 will also allow zero arguments in a similar way.

@end itemize

Some additional information for C++ is available at
Expand Down

0 comments on commit cbdc93e

Please sign in to comment.