什么是...语法上的可变参数?

What is ... variadic argument syntactically?

C/C++ 编译器认为 ... 是什么?需要明确的是,我不认为这是一个重复的问题,因为其他 stdarg 问题是关于“什么是可变参数 lists/how 它们有效吗?”那不是我的问题。

我翻遍了MSVC的include文件,找到了stdarg.h、vcruntime.h等,但还不是很满意。

编译器是否将 ... 视为运算符?链接器符号?宏?它不能是标识符,因为标识符中不允许使用该源字符 (.)。

如果我不得不猜测,我会说这类似于使用 __attribute__ 宏或 inlineregister 编译器“提示”来抑制 warnings/errors使用多个参数调用函数。

来自 ISO9899:

6.5.2.2 Function calls

Constraints

6 The ellipsis notation in a function prototype declarator causes argument type conversion to stop after the last declared parameter. The default argument promotions are performed on trailing arguments.

我想并不是所有的事情都需要准确确定,但我很好奇是否有更多的技术信息。

一个punctuator.

ISO 9899:

6.4.6 Punctuators
Semantics
2  A punctuator is a symbol that has independent syntactic and semantic significance. Depending on context, it may specify an operation to be performed (which in turn may yield a value or a function designator, produce a side effect, or some combination thereof) in which case it is known as an operator (other forms of operator also exist in somecontexts). An operand is an entity on which an operator acts.