早教吧 育儿知识 作业答案 考试题库 百科 知识分享

CFLAGS:=-Wall-Wstrict-prototypes-g-fomit-frame-pointer-ffreestandingMakefile中的这句话怎么理解?

题目详情
CFLAGS := -Wall -Wstrict-prototypes -g -fomit-frame-pointer -ffreestanding
Makefile中的这句话怎么理解?
▼优质解答
答案和解析
CFLAGS是一个变量,保存了后面的命令
gcc 提供了大量的警告选项,对代码中可能存在的问题提出警 告,通常可以使用-Wall来开启以下警告:
-Waddress -Warray-bounds (only with -O2) -Wc++0x-compat
-Wchar-subscripts -Wimplicit-int -Wimplicit-function-declaration
-Wcomment -Wformat -Wmain (only for C/ObjC and unless
-ffreestanding) -Wmissing-braces -Wnonnull -Wparentheses
-Wpointer-sign -Wreorder -Wreturn-type -Wsequence-point
-Wsign-compare (only in C++) -Wstrict-aliasing -Wstrict-overflow=1
-Wswitch -Wtrigraphs -Wuninitialized (only with -O1 and above)
-Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value
-Wunused-variable
下列选项控制编译器警告信息:
例如 : -Wstrict-prototypes 使用了非原型的函数声明时给出警告
参考一下: GNU Makefile 使用手册 吧.