Problem Set 5 - speller.cのアタマ、何故undefしているのか

既に聞いてくれているひとがいたよ。
cs50.stackexchange.com

次に私が感じた疑問は...
#undef getrusageだとヘッダファイルで定義されているgetrusageの定義もundefされないの?どうしてそれは無事なのかしら?
この答えは、
cs50.stackexchange.com

“The #undef undefines a constant or macro from the pre-processor. It is usually used to specify a constant for the preprocessor in a very specific range of the code.”
#undef, constantに影響はあるけどそれ以外は大丈夫らしい。
つまり、#define getrusage 定数 て騙すのを防ごうとしているのかな。

おまけ
undef, そもそも定義されていないときはどうなるんやろ...
Replacing text macros - cppreference.com
ここの#undef directiveをみると...
"The #undef directive undefines the identifier, that is it cancels the previous definition of the identifier by #define directive. If the identifier does not have an associated macro, the directive is ignored."
定義されていなかったら無視されるだけ、と。簡単な話ね。