-
Notifications
You must be signed in to change notification settings - Fork 4
Next #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: nextBase
Are you sure you want to change the base?
Next #7
Changes from all commits
bec5345
c8d8140
9c9d896
aa5fb75
9111db2
4d15c73
40e7db5
938076d
e7a1efd
0b97df2
14b3f07
1141052
c02b973
a0c0742
3db45e2
93dbbdd
92a59cf
65dff5d
94cbf58
83b338e
06ea8f8
5a68fc1
0cb3edc
b8b98ca
10593b6
cbda13f
b63328e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| # 忽略外部包 | ||
| externalModule/* | ||
| /test/externalModule/cJSON/** | ||
| /test/externalModule/yyjson/** |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Index: | ||
| Background: Build # 开启后台索引 | ||
|
|
||
| # 如果你的 compile_commands.json 不在根目录,需要在这里显式指定 | ||
| CompileFlags: | ||
| CompilationDatabase: ".vscode" | ||
|
|
||
| Diagnostics: | ||
| UnusedIncludes: None # 关键:这会关闭“未使用头文件”的提示 | ||
| MissingIncludes: None # 可选:关闭“缺失头文件”的提示 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,5 @@ build | |
| default.profdata | ||
| default.profraw | ||
| test/fuzzer/corpus | ||
| docs | ||
|
|
||
| fuzz-* | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,31 @@ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "clangd.enable": false, | ||||||||||||||||||||||
| "C_Cpp.intelliSenseEngine": "default", | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.enabled": true, | ||||||||||||||||||||||
| "c-cpp-flylint.enable": true, | ||||||||||||||||||||||
| "Lua.codeLens.enable": false, | ||||||||||||||||||||||
| "Lua.hint.enable": false, | ||||||||||||||||||||||
| "Lua.completion.enable": false, | ||||||||||||||||||||||
| "Lua.format.enable": false, | ||||||||||||||||||||||
| "Lua.hover.enable": false, | ||||||||||||||||||||||
| "Lua.diagnostics.enable": false, | ||||||||||||||||||||||
| "Lua.semantic.enable": false, | ||||||||||||||||||||||
| "Lua.addonManager.enable": false, | ||||||||||||||||||||||
| "Lua.signatureHelp.enable": false, | ||||||||||||||||||||||
| "clangd.enable": true, | ||||||||||||||||||||||
| "clangd.arguments": [], | ||||||||||||||||||||||
| "liveServer.settings.file": "${workspaceFolder}/coverage/**", | ||||||||||||||||||||||
| "liveServer.settings.ignoreFiles": [ | ||||||||||||||||||||||
| "**", // 第一步:先忽略所有文件(简单粗暴) | ||||||||||||||||||||||
| "!coverage/**" // 第二步:用感叹号 ! 把 coverage 目录“救”回来 | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "C_Cpp.intelliSenseEngine": "disabled", | ||||||||||||||||||||||
| "C_Cpp.errorSquiggles": "disabled", // 关闭微软的波浪线 | ||||||||||||||||||||||
| "C_Cpp.autocomplete": "disabled", // 关闭微软的自动补全 | ||||||||||||||||||||||
| "C_Cpp.default.compileCommands": "${workspaceFolder}/.vscode/compile_commands.json", | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.enabled": false, | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.args": [ | ||||||||||||||||||||||
| // "--extra-arg=-ferror-limit=1" | ||||||||||||||||||||||
| // "--extra-arg=-m32", | ||||||||||||||||||||||
| "--extra-arg=--target=arm-none-eabi-gcc" | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
|
Comment on lines
+23
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 目标三元组格式可能不正确。
🔧 建议修复 "C_Cpp.codeAnalysis.clangTidy.args": [
// "--extra-arg=-ferror-limit=1"
// "--extra-arg=-m32",
- "--extra-arg=--target=arm-none-eabi-gcc"
+ "--extra-arg=--target=arm-none-eabi"
],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| "c-cpp-flylint.enable": false, | ||||||||||||||||||||||
| "c-cpp-flylint.cppcheck.severityLevels": { | ||||||||||||||||||||||
| "error": "Error", | ||||||||||||||||||||||
| "warning": "Warning", | ||||||||||||||||||||||
|
|
@@ -12,49 +35,15 @@ | |||||||||||||||||||||
| "information": "Information" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "c-cpp-flylint.cppcheck.extraArgs": [ | ||||||||||||||||||||||
| // "--suppress=constParameterPointer", | ||||||||||||||||||||||
| // "--suppress=constParameterCallback", | ||||||||||||||||||||||
| "--suppress=constParameterPointer", | ||||||||||||||||||||||
| "--suppress=constParameterCallback", | ||||||||||||||||||||||
| "--check-level=exhaustive", | ||||||||||||||||||||||
| // "--suppress=variableScope", | ||||||||||||||||||||||
| // "--suppress=unreadVariable", | ||||||||||||||||||||||
| // "--suppress=constVariablePointer", | ||||||||||||||||||||||
| // "--suppress=constParameter", | ||||||||||||||||||||||
| "--suppress=variableScope", | ||||||||||||||||||||||
| "--suppress=unreadVariable", | ||||||||||||||||||||||
| "--suppress=constVariablePointer", | ||||||||||||||||||||||
| "--suppress=constParameter", | ||||||||||||||||||||||
| "--suppress=unusedStructMember", | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "files.watcherExclude": { | ||||||||||||||||||||||
| "**/test/fuzzer/corpus/**": true, | ||||||||||||||||||||||
| "./docs": true, | ||||||||||||||||||||||
| "./build": true, | ||||||||||||||||||||||
| "./.xmake": true, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "files.exclude": { | ||||||||||||||||||||||
| "**/test/fuzzer/corpus/**": true, | ||||||||||||||||||||||
| "./docs": true, | ||||||||||||||||||||||
| "./build": true, | ||||||||||||||||||||||
| "./.xmake": true, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "files.associations": { | ||||||||||||||||||||||
| "*.c": "c", | ||||||||||||||||||||||
| "inttypes.h": "c", | ||||||||||||||||||||||
| "float.h": "c", | ||||||||||||||||||||||
| "stdlib.h": "c", | ||||||||||||||||||||||
| "limits.h": "c", | ||||||||||||||||||||||
| "stdio.h": "c", | ||||||||||||||||||||||
| "stdint.h": "c", | ||||||||||||||||||||||
| "ryanjsontest.h": "c", | ||||||||||||||||||||||
| "dirent.h": "c", | ||||||||||||||||||||||
| "valloc.h": "c", | ||||||||||||||||||||||
| "initializer_list": "c", | ||||||||||||||||||||||
| "array": "c", | ||||||||||||||||||||||
| "string_view": "c", | ||||||||||||||||||||||
| "utility": "c", | ||||||||||||||||||||||
| "math.h": "c", | ||||||||||||||||||||||
| "compare": "c", | ||||||||||||||||||||||
| "type_traits": "c", | ||||||||||||||||||||||
| "cjson.h": "c", | ||||||||||||||||||||||
| "ryanjson.h": "c", | ||||||||||||||||||||||
| "string.h": "c", | ||||||||||||||||||||||
| "stdarg.h": "c", | ||||||||||||||||||||||
| "cstdlib": "c", | ||||||||||||||||||||||
| "ryanjsonconfig.h": "c" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "makefile.configureOnOpen": false, | ||||||||||||||||||||||
| "liveServer.settings.port": 5501 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,45 @@ | ||
|
|
||
| CFLAGS_INC = -I RyanJson | ||
| CFLAGS_INC += -I cJSON | ||
| CFLAGS_INC += -I yyjson | ||
| CFLAGS_INC += -I RyanJsonExample/valloc | ||
| CFLAGS_INC += -I RyanJsonExample | ||
| # 编译器设置 | ||
| CC = gcc | ||
| C_FLAGS = -std=gnu99 -O2 -Wall -Wextra -Wno-unused-parameter | ||
|
|
||
| # 头文件包含目录 | ||
| CFLAGS_INC = -I ./RyanJson | ||
| CFLAGS_INC += -I ./example | ||
| CFLAGS_INC += -I ./test | ||
| CFLAGS_INC += -I ./test/baseTest | ||
| CFLAGS_INC += -I ./test/externalModule/valloc | ||
| CFLAGS_INC += -I ./test/externalModule/tlsf | ||
| CFLAGS_INC += -I ./test/externalModule/cJSON | ||
| CFLAGS_INC += -I ./test/externalModule/yyjson | ||
|
|
||
| # 源文件扫描 (排除 fuzzer) | ||
| src = $(wildcard ./RyanJson/*.c) | ||
| src += $(wildcard ./cJSON/*.c) | ||
| src += $(wildcard ./yyjson/*.c) | ||
| src += $(wildcard ./RyanJsonExample/valloc/*.c) | ||
| src += $(wildcard ./RyanJsonExample/*.c) | ||
| src += $(wildcard ./example/*.c) | ||
| src += $(wildcard ./test/*.c) | ||
| src += $(wildcard ./test/baseTest/*.c) | ||
| src += $(wildcard ./test/externalModule/valloc/*.c) | ||
| src += $(wildcard ./test/externalModule/tlsf/*.c) | ||
| src += $(wildcard ./test/externalModule/cJSON/*.c) | ||
| src += $(wildcard ./test/externalModule/yyjson/*.c) | ||
|
|
||
| obj = $(patsubst %.c, %.o, $(src)) | ||
| target = app.o | ||
| CC = gcc | ||
| C_FLAGS = -Wall -Wextra -Wno-unused-parameter -Wformat=2 | ||
| # 中间对象 | ||
| obj = $(src:.c=.o) | ||
|
|
||
| # 目标程序 - 修改名字避免与源码文件夹 RyanJson 重名 | ||
| target = app | ||
|
|
||
| # 默认规则 | ||
| all: $(target) | ||
|
|
||
| $(target): $(obj) | ||
| $(CC) $(CFLAGS_INC) $(obj) $(C_FLAGS) -o $(target) -lm | ||
| $(CC) $(obj) $(C_FLAGS) -o $(target) -lm | ||
|
|
||
| # 编译模式规则 | ||
| %.o: %.c | ||
| $(CC) $(CFLAGS_INC) $(C_FLAGS) -c $< -o $@ -lm | ||
| $(CC) $(CFLAGS_INC) $(C_FLAGS) -c $< -o $@ | ||
|
|
||
| # 清理规则 | ||
| .PHONY: clean | ||
| clean: | ||
| rm -rf $(obj) $(target) | ||
| rm -f $(obj) $(target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 409
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 108
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 273
compile_commands.json 文件缺失。
CompilationDatabase 配置指向 ".vscode" 目录,但 compile_commands.json 在该目录(以及根目录)中都不存在。clangd 无法找到编译数据库,将无法正确索引和分析代码。需要生成 compile_commands.json 文件或将配置路径指向正确位置。
🤖 Prompt for AI Agents