# 2020q1 Homework1 (lab0)
contributed by < `lunasdejavu` >
:::danger
及早更新程式碼和共筆
Quote by Linus Torvalds:
> "Talk is cheap. Show me the code.""
:notes: jserv
:::
## 實驗環境
```shell
$ uname -a
Linux 5.3.0-40-generic #32~18.04.1-Ubuntu
$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
```
## 作業要求
詳見 [https://hackmd.io/@sysprog/linux2020-lab0](lab0) 描述。
## 實驗記錄
一開始跟著步驟 `git clone` 下來後 make 出現
```
CC qtest.o
CC report.o
CC console.o
CC harness.o
CC queue.o
In file included from queue.c:5:0:
harness.h:66:0: error: "strdup" redefined [-Werror]
#define strdup test_strdup
^
In file included from /usr/include/string.h:630:0,
from queue.c:3:
/usr/include/x86_64-linux-gnu/bits/string2.h:1291:0: note: this is the location of the previous definition
# define strdup(s) __strdup (s)
^
cc1: all warnings being treated as errors
Makefile:37: recipe for target 'queue.o' failed
make: *** [queue.o] Error 1
```
:::warning
近期 [lab0-c](https://github.com/sysprog21/lab0-c) 有些修正,請嘗試更新,方法為:
a. 切換到 lab0-c 的 workspace
b 執行 `$ git remote add upstream https://github.com/sysprog21/lab0-c`
c. 執行 `$ git fetch upstream`
d. 執行 `$ git rebase upstream/master`
最後一步可能會遇到衝突,可參見 [另一種合併方式(使用 rebase](https://gitbook.tw/chapters/branch/merge-with-rebase.html)。
:notes: jserv
:::