contributed by < happyincent >
-std=gnu11
ใๅ่ฉฆ Implicit Rulesใๅ ไธ dependency.PHONY
CFLAGS
[source]
-O0
: ้้ๅชๅ๏ผdefault optimization level-g
: Options for Debugging-Wall
: ๅ็จๅฎนๆ่ขซ้ฟๅ
็ warnings-Werror
: Make all warnings into errors.-std=gnu11
-std=c11
ๆ็กๆณ็ทจ่ญฏ
console.h
: unknown type name โfd_setโ
fd_set
ๅฎ็พฉๅจ <sys/select.h> ๅฑฌๆผ C POSIX library ่้ ISO Charness.c
: implicit declaration of function โrandomโ (โsigsetjmpโ)
$(GIT_HOOKS)
scripts/install-git-hooks
ๆๆ touch ๆชๆก: .git/hooks/applied
$(GIT_HOOKS)
ๆชๆกๅทฒๅญๅจไธ้ๅ target ๆฒๆ prerequisites ้่ฆ็ขบ่ช๏ผๅ ๆญค Make ๆ่ช็บๅทฒ็ถ up to date ไพฟไธๆๅๅท่ก
@
: ไธ echo ่ฉฒ่กๆไปค (Recipe Echoing):=
: Simply expanded variables, =
: recursively expanded variables,?=
: conditional variable assignment [source]
all
queue.o, qtest
-c
: compile or assemble the source files, but do not link-o file
: output in file filedep
[source]
-M
: output a rule suitable for make describing the dependencies of the main source file-MM
: ๆพๅบ้ include ็ณป็ตฑไธ้้ๆฅ include ็ source file dependencies
test
clean
.dSYM
: debug symbols*~
: ็ทจ่ผฏๅจๅไปฝๆชQueue Structure
size_t q_size
ไพ้ๆๅจ O(1) ๆ้ๅ
งๅพๅฐ queue elements ็ๆธ็ฎ
sizeof(long) = sizeof(size_t)
[stackoverflow: size_t ]list_ele_t *tail
็ด้ queue ไธญ tail element ็ไฝๅq_insert_head
static inline list_ele_t *ele_new(char *s)
๏ผไฝ็ผ็พๆ้ ๆๆดๅค็ jmp (BL, BNE, โฆ) ๆฌกๆธ
-O0
(optimization level 0) ๆๅฏ่ฝไธๆๅฑ้ inline [source] [gcc-inline]
__attribute__((always_inline))
ๅผทๅถๅ inlineq_reverse
-O0
(ไธๅๅทฆ)ใ-O1
(ไธๅๅณ) compile queue.c๏ผไธฆๆฏ่ผ IDA Pro disassemble ๅพ q_insert_head
็ graph ๅO0
ๆๅค้ 8 ๆฌก jmpO1
ๆๅค้ 6 ๆฌก jmpO0
ๆๅค้ 6 ๆฌก jmpO1
ๆๅค้ 3 ๆฌก jmp-O0
ERROR: Time limit exceeded
-O0, -O1, -O2, -O3
ๆธฌ่ฉฆ 10 ๆฌกไธฆ่จ็ฎๅนณๅๅๆธ (timeout 10 ็ง total = 0)