CFLAGS := -Wall -Wstrict-prototypes -g -fomit-frame-pointer

1个回答

  • 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 使用手册 吧.