Move _GNU_SOURCE from CCFLAGS to CPPDEFINES by maxgerhardt · Pull Request #8579 · esp8266/Arduino (original) (raw)

PlatformIO generates the c_cpp_properties.json by executing the template logic here and here.

Indeed, the -U__STRICT_ANSI__ does not appear in this file (see e.g. here for after PR state). And looking at the microsoft docs, they have defines, but not undefines, so not sure how to inform Intellisense about that all.

But of course PlatformIO still gives that -U flag into the compilation process. It's just the VSCode Intellisense that knows nothing about it -- and it doesn't seem to be causing display issues with missing functions.

To be clear again, the c_cpp_properties.json just controls VSCode's Intellisense, i.e. how it displays the code and what include folders and activated macros it knows about. Actual firmware compilation is doen by the PlatformIO core where -D_GNU_SOURCE and -U__STRICT_ANSI__ is given as normal (since its in CCFLAGS, or CPPDEFINES for the first one after this PR). The compiled binary has no problems, just VSCode Intellisense display stuff.