Pio builds fine but linter show errors on library calls


I am currently working on an ESP8266 without any framework, the project builds and works but linter still reports errors when function from Espressif SDK are called.

Errors reported

The function os_printf() is in the following file


There is no error on the line #include "osapi.h" at the beginning of my file.

The following line has been added automatically to .clan_completed file.


Did I missed a configuration ? Thank you

platformio.ini file:

platform = espressif8266
board = d1_mini
build_flags = -Wl,-T"eagle.app.v6.ld"

IDE v1.7.1
Core v3.2.1

Could you provide a simple project to reproduce this issue?

In fact I just solved it when preparing the project for you, thanks to “pio run --target clean”, and I am not able to reproduce the issue with a new project :confused:
So you might consider it closed for now, I will send you the project if I have it again in the future.

I have noticed a similar error when using the spi.transfer method from mbed. The problem seems to be rather intermittent, it comes and goes apparently at random.

I think it is linked to the fact that the spi.transfer function is only defined for certain target boards. In the header files, it is guarded by #ifdef statements that depend on the target. I guess somehow the linter doesn’t know whether it should be defining these macros or not.