Skip to content

Parse #define from included files like autoconf.h #14183

@jankapte

Description

@jankapte

Feature Request

Looks like the extension does not pick up #define or other preprocessor directives from header files:

autoconf.h:
Image

c_cpp_properties.json:
Image

(full config below)
Results in grayed out section:

Image

using "defines": ["CONFIG_ENG"] does work:

Image

I'd prefer not to use the "defines" array, because there are many defines and they change from build config to build config and instead I'd love to parse the defines from the autoconf.h.

Is that possible already or would that be a new feature?

Thanks.

full config:

{
    "configurations": [
        {
            "name": "GCC DevContainer",
            "cStandard": "c17",
            "cppStandard": "gnu++20",
            "compilerPath": "/opt/arm-gnu-toolchain-x86_64-arm-none-eabi/13.3.rel1/bin/arm-none-eabi-gcc",
            "intelliSenseMode": "linux-gcc-arm",
            "compilerArgs": [
                "-mcpu=cortex-m4",
                "-mthumb",
                "-mfloat-abi=hard",
                "-mfpu=fpv4-sp-d16",
                "-mabi=aapcs",
                "-DARM_MATH_CM4",
                "-D__FPU_PRESENT=1",
                "-ffunction-sections",
                "-fdata-sections",
                "-fno-strict-aliasing",
                "-fno-builtin",
                "-fshort-enums",
                "-Wno-unused-function",
                "-fmerge-all-constants",
                "-fomit-frame-pointer",
                "-Og",
                "-fno-unroll-loops",
                "-fno-inline",
                "-fno-code-hoisting",
                "-fno-strict-aliasing",
                "-fno-schedule-insns",
                "-fno-schedule-insns2",
                "-g"
            ],
            // "defines": ["CONFIG_ENG"],
            "forcedInclude": [
                "out/autoconf.h"
            ],
            "mergeConfigurations": true,
            "includePath": [
                "out/"
            ]
        }
    ],
    "version": 4,
    "enableConfigurationSquiggles": true
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions