◆unused-function:遇到仅声明过但尚未定义的静态函数时发出警告。 ◆unused-label:遇到声明过但不使用的标号的警告。 ◆unused-parameter:从未用过的函数参数的警告。 ◆unused-variable:在本地声明但从未用过的变量的警告。 ◆unused-value:仅计算但从未用过的值得警告。 ◆Format:检查对printf和scanf等函数的调用,...
在GCC(GNU Compiler Collection)中,隐藏"已定义但未使用"的警告可以通过添加编译选项来实现。具体操作如下: 打开终端或命令行工具。 进入源代码文件所在的目录。 输入以下命令进行编译: 代码语言:txt 复制 gcc -c -Wno-unused-function -Wno-unused-variable source_file.c ...
◆unused-function:遇到仅声明过但尚未定义的静态函数时发出警告。 ◆unused-label:遇到声明过但不使用的标号的警告。 ◆unused-parameter:从未用过的函数参数的警告。 ◆unused-variable:在本地声明但从未用过的变量的警告。 ◆unused-value:仅计算但从未用过的值得警告。 ◆Format:检查对printf和scanf等函数的调用,...
unused-function:警告声明但是没有定义的static函数; unused- label:声明但是未使用的标签; unused-parameter:警告未使用的函数参数; unused-variable:声明但是未使用的本地变量; unused-value:计算了但是未使用的值; format:printf和scanf这样的函数中的格式字符串的使用不当; implicit-int:未指定类型; implicit-functi...
5.3 -Wno-unused-function 和代码清洁度 5.4 其他编译器警告和心理学的联系 深入底层:源码与心理学 6.1 源码的重要性 6.2 探索源码的心理学 6.3 源码中的设计模式 6.4 源码和心理学的交叉点 结语 引言 在编程的世界中,我们经常会遇到各种技术难题,但这些难题背后往往隐藏着人性的挑战。正如心理学家 Carl Rogers ...
◆unused-function:遇到仅声明过但尚未定义的静态函数时发出警告。 ◆unused-label:遇到声明过但不使用的标号的警告。 ◆unused-parameter:从未用过的函数参数的警告。 ◆unused-variable:在本地声明但从未用过的变量的警告。 ◆unused-value:仅计算但从未用过的值得警告。
main.c:9:void unused_func1(int a) **Binary file test matches** test.i:735:void unused_func1(int a) Binary file test.o matches test.s:7: .globl unused_func1 test.s:8: .type unused_func1, @function test.s:9:unused_func1: ...
-Wunused-function 有未使用的函数时警告 -Wunused-label 有未使用的标号时警告 -Wunused-macros 当定义在主文件中的宏未被使用时给出警告 -Wunused-parameter 发现未使用的函数指针时给出警告 -Wunused-result 当一个带有 warn_unused_result 属性的函数的调用者未使用前者的返回值时给出警告 ...
gcc -Wunused-parameter -c test_unused.c //如果不是用-Wunused-parameter,则func4函数将不被警告。 test_unused.c: In function `func3': test_unused.c:30: label `over' used but not defined test_unused.c: In function `func7': test_unused.c:35: warning: deprecated use of label at end ...
unused-function:警告声明但是没有定义的static函数;unused- label:声明但是未使⽤的标签;unused-parameter:警告未使⽤的函数参数;unused-variable:声明但是未使⽤的本地变量;unused-value:计算了但是未使⽤的值;format:printf和scanf这样的函数中的格式字符串的使⽤不当;implicit-int:未指定类型;implicit-...