clangd 提示错误的问题,请老师指点一下

程序可编译通过。每个 .c 文件第一行,clangd 都会有如下错误提示:

"message": "Unknown argument: '-mapcs'",	"source": "clang",	"startLineNumber": 1, 
     startColumn": 1,	"endLineNumber": 1,	"endColumn": 1

"message": "Unknown argument: '-mno-sched-prolog'",  "source": "clang", "startLineNumber": 1,
"startColumn": 1, 	"endLineNumber": 1, 	"endColumn": 1

"message": "Unknown argument: '-fno-ipa-sra'",  "source": "clang", "startLineNumber": 1,
"startColumn": 1, 	"endLineNumber": 1, "endColumn": 1

"message": "Unknown argument: '-mno-thumb-interwork'", 	"source": "clang", 	"startLineNumber": 1,
"startColumn": 1, 	"endLineNumber": 1, 	"endColumn": 1

"message": "Unknown argument: '-fno-var-tracking-assignments'", "source": "clang",
"startLineNumber": 1, 	"startColumn": 1, 	"endLineNumber": 1, 	"endColumn": 1

"message": "Unknown argument: '-fconserve-stack'",  "source": "clang", "startLineNumber": 1,
"startColumn": 1, "endLineNumber": 1,  "endColumn": 1

"message": "Unused function '__inittest'", "source": "clang", "startLineNumber": 73,
"startColumn": 1,  "endLineNumber": 73, "endColumn": 12,  "tags": [1]

"message": "Unused function '__exittest'",  "source": "clang", "startLineNumber": 74,
"startColumn": 1, "endLineNumber": 74, "endColumn": 12, "tags": [1]

在最上面目录里面加一个.clangd文件,文件内容如下:
CompileFlags:
Remove: [-mapcs,-mno-sched-prolog,-fno-ipa-sra,-mno-thumb-interwork,-fno-var-tracking-ssignments,-fconserve-stack]

老师好,我也遇到了这个问题,创建了.clangd文件以后出现了如下错误:


请问该怎么解决

1 个赞

解决了吗。。。。。。。。。。。。

解决了吗。。。。。。。。。。。。。。。

解决了吗好兄弟。。。。。。。。。。。。