Linux版 - linux code中到处都是ifdef, 怎样方便地看出真正的code path ? |
|
|
|
|
|
s*****w 发帖数: 1527 | 1 for the following, why some -D are in front of some -I ?
does that mean these defines are only for the include path following it ?
[somehow@bsd ~/bsd_src/lib/libc]$ make
Warning: Object directory not changed from original
/usr/home/somehow/bsd_src/lib/libc
cc -O2 -pipe -I/usr/home/somehow/bsd_src/lib/libc/include -
I/usr/home/somhhow/bsd_src/lib/libc/../../include -
I/usr/home/somehow/bsd_src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -
I/usr/home/somehow/bsd_src/lib/libc/../../contrib/gdtoa -DINET6 -
I/usr/home/somehow/bsd_src/lib/libc -
I/usr/home/somehow/bsd_src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -
I/usr/home/somehow/bsd_src/lib/libc/locale -DBROKEN_DES -DPORTMAP -
DDES_BUILTIN -I/usr/home/somehow/bsd_src/lib/libc/rpc -DYP -DNS_CACHING -
DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers -Werror -
Wall
-Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c
/usr/home/somehow/bsd_src/lib/libc/stdio/printf.c
building static c library | S*A 发帖数: 7142 | 2 The kernel is pretty much against using ifdef inside
the C file. Much prefer move the ifdef to some header file.
-D vs -I there is not order requirement.
Back to your question, I don't know a easy way other
than follow the source code.
【在 s*****w 的大作中提到】![](/moin_static193/solenoid/img/up.png) : for the following, why some -D are in front of some -I ? : does that mean these defines are only for the include path following it ? : [somehow@bsd ~/bsd_src/lib/libc]$ make : Warning: Object directory not changed from original : /usr/home/somehow/bsd_src/lib/libc : cc -O2 -pipe -I/usr/home/somehow/bsd_src/lib/libc/include - : I/usr/home/somhhow/bsd_src/lib/libc/../../include - : I/usr/home/somehow/bsd_src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE - : I/usr/home/somehow/bsd_src/lib/libc/../../contrib/gdtoa -DINET6 - : I/usr/home/somehow/bsd_src/lib/libc -
|
|
|
|
|
|