Compiler 2013: Semantic specification
外观
General Considerations
continueandbreakmust be in a loop- In
a.b,bmust be a field ofa's type - Variable declarations are not allowed in loop conditions
- Void-type variables are not writable
Typing
- The type of the expression in a
returnstatement must match the return type of the function returnstatements are not mandatory, even in a non-void function- In
a[expr],amust be a pointer (or array), andexprmust be int/char
Scoping
- Field names should be unique within a
struct - Function names should be unique
- Variables in the same level/scope should be unique
- Reading: http://stackoverflow.com/questions/3793952/understanding-c-namespaces
Refer to gcc 4.7.1 for any semantic issues not mentioned above.