Skip to content

invalid define when using custom env.variable #8695

@heartacker

Description

@heartacker

Bug type: Language Service

Describe the bug
版本: 1.64.0-insider (system setup)
提交: 16856037e075275f53b25b7e2dec2303e8e25728
日期: 2022-01-19T05:15:25.456Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.14393
c/c++: 1.8.0

To Reproduce

  • there is the c_cpp_properties.json
{
 "env": {
        "MDK_DEFINES": [
            "__CC_ARM",
            "__arm__",
            "__align(x)=",
            "__ALIGNOF__(x)=",
            "__alignof__(x)=",
            "__asm(x)=",
            "__forceinline=",
            "__restrict=",
            "__global_reg(n)=",
            "__inline=",
            "__int64=long long",
            "__INTADDR__(expr)=0",
            "__irq=",
            "__packed=",
            "__pure=",
            "__smc(n)=",
            "__svc(n)=",
            "__svc_indirect(n)=",
            "__svc_indirect_r7(n)=",
            "__value_in_regs=",
            "__weak=",
            "__writeonly=",
            "__declspec(x)=",
            "__attribute__(x)=",
            "__nonnull__(x)=",
            "__register=",
            "__breakpoint(x)=",
            "__cdp(x,y,z)=",
            "__clrex()=",
            "__clz(x)=0U",
            "__current_pc()=0U",
            "__current_sp()=0U",
            "__disable_fiq()=",
            "__disable_irq()=",
            "__dmb(x)=",
            "__dsb(x)=",
            "__enable_fiq()=",
            "__enable_irq()=",
            "__fabs(x)=0.0",
            "__fabsf(x)=0.0f",
            "__force_loads()=",
            "__force_stores()=",
            "__isb(x)=",
            "__ldrex(x)=0U",
            "__ldrexd(x)=0U",
            "__ldrt(x)=0U",
            "__memory_changed()=",
            "__nop()=",
            "__pld(...)=",
            "__pli(...)=",
            "__qadd(x,y)=0",
            "__qdbl(x)=0",
            "__qsub(x,y)=0",
            "__rbit(x)=0U",
            "__rev(x)=0U",
            "__return_address()=0U",
            "__ror(x,y)=0U",
            "__schedule_barrier()=",
            "__semihost(x,y)=0",
            "__sev()=",
            "__sqrt(x)=0.0",
            "__sqrtf(x)=0.0f",
            "__ssat(x,y)=0",
            "__strex(x,y)=0U",
            "__strexd(x,y)=0",
            "__strt(x,y)=",
            "__swp(x,y)=0U",
            "__usat(x,y)=0U",
            "__wfe()=",
            "__wfi()=",
            "__yield()=",
            "__vfp_status(x,y)=0"
        ],
        "KEIL_C51_DEFINES": [
            "reentrant=",
            "compact=",
            "small=",
            "large=",
            "data=",
            "idata=",
            "pdata=",
            "bdata=",
            "xdata=",
            "code=",
            "bit=char",
            "sbit=char",
            "sfr=char",
            "sfr16=int",
            "sfr32=int",
            "interrupt=",
            "using=",
            "_at_==",
            "_priority_=",
            "_task_="
        ]
    },
    "configurations": [
        {
            //^ 此配置适合cortexm 结合vscode进行编辑
            "name": "CortexM",
            "includePath": [
                "${default}",
                "${workspaceFolder}/**",
                //! 以下路径建议你也把keil 安装到这个 地方
                "C:\\Keil_v5\\ARM\\ARMCC\\include",
                "C:\\Keil_v5\\ARM\\ARMCC\\include\\rw",
                "C:\\Keil_v5\\ARM\\PACK\\ARM\\CMSIS\\5.8.0\\CMSIS\\**"
            ],
            "defines": [
                "${env.MDK_DEFINES}" // 
            ],
            "intelliSenseMode": "windows-msvc-arm"
        }
    ],
    "version": 4
}
  • errMsg
[{
	"resource": "/f:/ATCProjectFiles/MCU/AC7840x/HQA/code/HQA/driver/ckgen/ckgen_drv.c",
	"owner": "C/C++",
	"code": "992",
	"severity": 8,
	"message": "命令行错误: 宏定义无效: __CC_ARM;__arm__;__align(x)=;__ALIGNOF__(x)=;__alignof__(x)=;__asm(x)=;__forceinline=;__restrict=;__global_reg(n)=;__inline=;__int64=long long;__INTADDR__(expr)=0;__irq=;__packed=;__pure=;__smc(n)=;__svc(n)=;__svc_indirect(n)=;__svc_indirect_r7(n)=;__value_in_regs=;__weak=;__writeonly=;__declspec(x)=;__attribute__(x)=;__nonnull__(x)=;__register=;__breakpoint(x)=;__cdp(x,y,z)=;__clrex()=;__clz(x)=0U;__current_pc()=0U;__current_sp()=0U;__disable_fiq()=;__disable_irq()=;__dmb(x)=;__dsb(x)=;__enable_fiq()=;__enable_irq()=;__fabs(x)=0.0;__fabsf(x)=0.0f;__force_loads()=;__force_stores()=;__isb(x)=;__ldrex(x)=0U;__ldrexd(x)=0U;__ldrt(x)=0U;__memory_changed()=;__nop()=;__pld(...)=;__pli(...)=;__qadd(x,y)=0;__qdbl(x)=0;__qsub(x,y)=0;__rbit(x)=0U;__rev(x)=0U;__return_address()=0U;__ror(x,y)=0U;__schedule_barrier()=;__semihost(x,y)=0;__sev()=;__sqrt(x)=0.0;__sqrtf(x)=0.0f;__ssat(x,y)=0;__strex(x,y)=0U;__strexd(x,y)=0;__strt(x,y)=;__swp(x,y)=0U;__usat(x,y)=0U;__wfe()=;__wfi()=;__yield()=;__vfp_status(x,y)=0",
	"source": "C/C++",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}]

"defines": [
"${env.MDK_DEFINES}" //
],
Expected behavior

Screenshots
image

Additional context

Metadata

Metadata

Assignees

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.insidersCurrently only repros with our latest Insiders release.quick fixregressionA bug that didn't exist in a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions