I’ve been exposed to numerous coding guidelines, every one of them giving guidelines for naming ‘things’. One specific C89 naming rule triggered this question: It was explicitly forbidden to use the name ‘new’ for a variable, because in C++ this is a keyword.
This started me thinking about the next standards, C99 is well documented, but C11 is relatively new (2014). And the Standards committee has several extensions still in the works.
Therefore I’m wondering if someone can provide a list with keywords and their origins, in order to make a set of naming rules, including the reasons why several names are to be avoided.
And although strictly spoken complex is not a keyword, similar definitions would best be included. And C++ information is also appreciated.
Thanks for all the answers and comments, but simply having a list of keywords was not quite the intention of my question. Especially,
has apparently been overlooked. But when drafting a coding guideline, you’re always required to give a rationale for each restriction.
That’s why I’ve started to collect my own data, and put it in a document. I’m still working on it, especially the AM1 amendment to the C90 Standard in 1995 is not fully included, for C++ only the latest C++11 Standard has been used (partly), several Technical Reports still need inclusion, etc. But since I’m currently not pursuing many updates because of workload, I’ve put a draft-version for download on my website.
If you’re interested, look here: Reserved Words In C (pdf).
Additions and corrections are always welcome, contact info on my website.
FWIW.