# 2024q1 Homework1 (lab0) contributed by < [dcciou](https://github.com/dcciou) > ## insert_head 超時 ```diff bool q_insert_head(struct list_head *head, char *s) { - list_add(&new_element->list, head); + new_element->list.next = head->next; + head->next->prev = &new_element->list; + head->next = &new_element->list; + new_element->list.prev = head; ``` ## `-Wno-incompatible-pointer-types` 當我想讓if-else減少時,出現了這個問題,GCC說明如下: - > Do not warn when there is a conversion between pointers that have incompatible types. This warning is for cases not covered by -Wno-pointer-sign, which warns for pointer argument passing or assignment with different signedness. By default, in C99 and later dialects of C, GCC treats this issue as an error. The error can be downgraded to a warning using -fpermissive (along with certain other errors), or for this error alone, with -Wno-error=incompatible-pointer-types. This warning is upgraded to an error by -pedantic-errors. ## error: ‘return’ with a value, in function returning void [-Werror=return-type] 把null刪除即可 ## 進度 ```diff --- TOTAL 64/100 ``` 測試最高分為64,github上的程式碼為本版本。 加入sort,merge等程式碼後分數降低,因此放上最高分數的版本 ## 其他 ### 進到 folder 跟 directory 之間的<s>指令</s> 差別 - cd /... 只會進到 folder 的前一層 - cd ~/... 才會進到 folder 內 ### make 遇到: Fatal: GitHub Actions MUST be activated. - 登入 github 帳號,應該會自動跳出你 disable 了什麼,調成 enable 即可 :::danger 1. 中文和英文字元之間要有空白字元 (對排版和文字搜尋有利) 2. 留意[資訊科技詞彙翻譯](https://hackmd.io/@sysprog/it-vocabulary) 3. 改進你的漢語表達 4. 上述問題沒改進前,不要刪去本訊息。 5. 留意各式細節,唯有重視小處並步步為營,方可挑戰原始程式碼規模超越三千七百萬行的 Linux 核心。 :::