Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一部の C プロジェクトで、次のコードを見たことがあります。
static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; /* some code not using `ud` or `osize` */ return ptr; }
void への 2 つのキャストは何か目的を果たしますか?
一部のパラメーターが使用されていないため、コンパイラーからの警告を回避するためにあります。