Compiler 2013: Semantic specification
外观
General Considerations
continue
andbreak
must be in a loop- In
a.b
,b
must 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
return
statement must match the return type of the function return
statements are not mandatory, even in a non-void function- In
a[expr]
,a
must be a pointer (or array), andexpr
must 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.