Open Pwuts opened 4 years ago
When fixing this issue, the function header must not only be added as a forward declaration, but the default arguments have to be removed from the function definition, otherwise the compiler will throw an error like error: default argument given for parameter 1 of 'void test(int t)'
.
So this
/* [other code] */
void test(int t = 1)
{
Serial.print(t);
}
becomes
void test(int t = 1);
/* [other code] */
void test(int t)
{
Serial.print(t);
}
It goes for very simple functions; the following function is not included in the forward declarations:
... while the function below is included in the forward declarations:
Tested in the Arduino IDE, with PlatformIO, and with the standalone
arduino-preprocessor.exe
which I downloaded from the releases page.As a result of this bug, I get errors at compile time, like this:
Debug info First part of the preprocessor's output:
The resulting forward declarations:
As you can see,
mqtt_publish
is missing in the forward declarations.