Difference between revisions of "cpp/header/cstdarg"
From cppreference.com
(synopsis) |
m (→Defect reports) |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
{{cpp/header/c}} | {{cpp/header/c}} | ||
− | This header provides support for [[cpp/utility/variadic|C-style variadic functions]]. | + | This header provides support for [[cpp/utility/variadic|C-style variadic functions]], while the [[c/language/conversion#Default argument promotions|C definition]] of "default argument promotions" is replaced with the [[cpp/language/variadic arguments#Default conversions|C++ definition]]. |
{{dsc begin}} | {{dsc begin}} | ||
Line 18: | Line 18: | ||
{{source|1= | {{source|1= | ||
namespace std { | namespace std { | ||
− | using va_list = /* | + | using va_list = /*see description*/ ; |
} | } | ||
− | + | #define va_arg(V, P) /*see description*/ | |
− | #define va_arg(V, P) /* | + | #define va_copy(VDST, VSRC) /*see description*/ |
− | #define va_copy(VDST, VSRC) /* | + | #define va_end(V) /*see description*/ |
− | #define va_end(V) /* | + | #define va_start(V, P) /*see description*/ |
− | #define va_start(V, P) /* | + | |
}} | }} | ||
+ | |||
+ | ===Defect reports=== | ||
+ | {{dr list begin}} | ||
+ | {{dr list item|wg=cwg|dr=2645|std=C++98|before=C++ defines "default argument promotions", but its C definition was used|after=the C++ definition overrides the C definition}} | ||
+ | {{dr list end}} | ||
+ | |||
+ | {{langlinks|es|ja|ru|zh}} |
Latest revision as of 04:22, 20 January 2023
This header was originally in the C standard library as <stdarg.h>.
This header provides support for C-style variadic functions, while the C definition of "default argument promotions" is replaced with the C++ definition.
Types | ||
holds the information needed by va_start, va_arg, va_end, and va_copy (typedef) | ||
Macros | ||
enables access to variadic function arguments (function macro) | ||
accesses the next variadic function argument (function macro) | ||
(C++11) |
makes a copy of the variadic function arguments (function macro) | |
ends traversal of the variadic function arguments (function macro) |
[edit] Synopsis
namespace std { using va_list = /*see description*/ ; } #define va_arg(V, P) /*see description*/ #define va_copy(VDST, VSRC) /*see description*/ #define va_end(V) /*see description*/ #define va_start(V, P) /*see description*/
[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
CWG 2645 | C++98 | C++ defines "default argument promotions", but its C definition was used | the C++ definition overrides the C definition |