[問題] __attribute__
http://nshipster.com/__attribute__/
查了一下 在 GCC 時代
可以用__attribute__ 來檢查傳入的 parameter 是否為 null
來進行 compile time的提醒 例如:
extern void *my_memcpy (void *dest, const void *src, size_t len)
__attribute__((nonnull (1, 2)));
在現在的 LLVM 底下,有辦法在 compile time 時對 Obj-C message 做一樣的事情嗎?
例如:
+ (void) managerWithIdentifier:(NSString*)identifier
__attribute__(nonnull (1));
這樣寫好像不會進行 compile time check...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 223.142.142.72
→
08/19 10:43, , 1F
08/19 10:43, 1F
→
08/19 10:44, , 2F
08/19 10:44, 2F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章