All Questions
Tagged with c23 c-preprocessor
3
questions
2
votes
1
answer
177
views
error: must specify at least one argument for '...' parameter of variadic macro
You can define a variadic macro in C like:
#define F(x, ...) f(x, __VA_ARGS__)
But calling F as F(a) results in the macro expansion f(a,) which would not compile.
So C23 includes __VA_OPT__ to ...
0
votes
2
answers
113
views
Consolidating GNU C's and C23's deprecated function attribute
The problem I am facing when using the below macro
// Assume that __GNUC__ or __clang__ is defined.
#if defined(__has_c_attribute)
#if __has_c_attribute(deprecated)
#define ...
9
votes
3
answers
1k
views
How can I use "nullptr" for null pointers prior to C23?
In C23, the nullptr keyword got standardized. I would prefer to use nullptr instead of NULL prior to C23 too because it means that I could write code which compiles in:
C, prior to C23
C, since C23
C+...