-
Couldn't load subscription status.
- Fork 45
Open
Labels
feature requestFeature requestsFeature requests
Description
Feature Request
What is the nature of this request?
- Change in source code details (names of variables, functions, parameters, etc)
Is your feature request related to a problem? Please describe.
cmc log functions from log.h, cmc_log_trace for example, are defined as:
#define cmc_log_trace(fmt, ...) cmc_log(CMC_LOG_TRACE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)##__VA_ARGS__ is supported by most compilers, but still non-standard, -pedantic issues a warning about it.
C23 solves the problem by introducing the __VA_OPT__ preprocessor. So this is the C23 solution:
#define cmc_log_trace(fmt, ...) cmc_log(CMC_LOG_TRACE, __FILE__, __func__, __LINE__, fmt __VA_OPT__(,) __VA_ARGS__)Full C23 support is yet to be available, so not a high priority.
Describe the solution you'd like
Detect the version via __STDC_VERSION__, and use the standard solution if C23 or later.
Metadata
Metadata
Assignees
Labels
feature requestFeature requestsFeature requests