Keywords (annotated)

6.4.1 Keywords

The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as keywords, and shall not be used otherwise.

keywords出現在phase7開始,在之前是屬於preprocessor token的identifier

上面的紅框是C99新增的keyword,_Bool定義成_Bool而不是bool,主要的原因是在C89的標準中,對於reserved identifier是用 底線+大寫字母開頭 或是 雙底線。提供了後續標準新增的關鍵字避免使用上與使用者衝突。另外在標準中提到 Implementation-defined keywords shall have the form of an identifier reserved for any use as described in 7.1.3. 也是同樣的理由

This entry was posted in C Language. Bookmark the permalink.

Leave a Reply