#define BUTTON_PORT_NUMBER 2
#define BTN_PIEZO_PIN (0x04)
/// Helper macro to concatenate the parameters
#define CONCATENATOR(x, y) x ## y
/// Helper macro to evaluate the parameters before concatenating
#define EVALUATOR(x, y) CONCATENATOR(x, y)
/// Helper macro to evaluate button port number and add it to 'P'
#define BUTTON_PORT EVALUATOR(P, BUTTON_PORT_NUMBER)
/// Direction port for button
#define BUTTON_PORT_DIR (EVALUATOR(BUTTON_PORT, DIR))
void func(void)
{
BUTTON_PORT_DIR &= (uint8_t)(~BTN_PIEZO_PIN);
}
I get the message:
Id: checkLibraryFunction
Summary: --check-library: There is no matching configuration for function EVALUATOR()
wherever i use BUTTON_PORT_DIR.
Maybe an issue with the new preprocessor?
For the exact same code with 1.74 there was no such message.
Is it worth a ticket?
Regards
Sebastian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For code like this:
I get the message:
Id: checkLibraryFunction
Summary: --check-library: There is no matching configuration for function EVALUATOR()
wherever i use BUTTON_PORT_DIR.
Maybe an issue with the new preprocessor?
For the exact same code with 1.74 there was no such message.
Is it worth a ticket?
Regards
Sebastian
Please try cppcheck -E
If that output looks wrong, for instance if EVALUATOR is not expanded, please open an issue in the simplecpp issue tracker:
https://github.com/danmar/simplecpp/issues
The output with -E for the above code is:
EVALUATOR is only expanded once.
I will create an issue for this.
Opened issue for simplecpp:
https://github.com/danmar/simplecpp/issues/31