当前位置: 技术问答>linux和unix
关于makefile gcc编译选项,请教。
来源: 互联网 发布时间:2016-12-23
本文导语: all: gcc -Wall -Wno-unused-function -g bintree/*.c -o bintree/bintreetest gcc -Wall -Wno-unused-function -g heap/*.c -o heap/heaptest gcc -Wall -Wno-unused-function -g rbtree/*.c -o rbtree/rbtreetest gcc -Wall -Wno-unused-function -g smalldicty/*.c -o small...
all:
gcc -Wall -Wno-unused-function -g bintree/*.c -o bintree/bintreetest
gcc -Wall -Wno-unused-function -g heap/*.c -o heap/heaptest
gcc -Wall -Wno-unused-function -g rbtree/*.c -o rbtree/rbtreetest
gcc -Wall -Wno-unused-function -g smalldicty/*.c -o smalldicty/smalldicty
gcc -Wall -Wno-unused-function -g utils/memview.c -o utils/memview
在github上面看到这样一段gcc编译,谁能解释一下 -Wno-unused-function 这是什么意思吗?谢谢。
gcc -Wall -Wno-unused-function -g bintree/*.c -o bintree/bintreetest
gcc -Wall -Wno-unused-function -g heap/*.c -o heap/heaptest
gcc -Wall -Wno-unused-function -g rbtree/*.c -o rbtree/rbtreetest
gcc -Wall -Wno-unused-function -g smalldicty/*.c -o smalldicty/smalldicty
gcc -Wall -Wno-unused-function -g utils/memview.c -o utils/memview
在github上面看到这样一段gcc编译,谁能解释一下 -Wno-unused-function 这是什么意思吗?谢谢。
|
缺省值是
-Wno-unused-function
man gcc
====
Many options have long names starting with -f or with -W---for example,
-fmove-loop-invariants, -Wformat and so on. Most of these have both
positive and negative forms; the negative form of -ffoo would be
-fno-foo. This manual documents only one of these two forms, whichever
one is not the default.
-Wno-unused-function
man gcc
====
Many options have long names starting with -f or with -W---for example,
-fmove-loop-invariants, -Wformat and so on. Most of these have both
positive and negative forms; the negative form of -ffoo would be
-fno-foo. This manual documents only one of these two forms, whichever
one is not the default.
|
发现不使用的函数不警告
|
man gcc 后确实发现只有-Wunused-function,没有-Wno-unused-function
那么,我们是否可以推出如下结论,"-Wxxxx"选项都有对应的相反意义的选项"-Wno-xxx"?