# Language Extensions

CScout implements the C language as defined in ANSI X3.159-1989. In addition, it supports the following extensions:

1. Preprocessor directives can appear within a call to a function-like macro (gcc)
2. Initializers and compound literals can be empty (gcc)
3. The `alignof` operator can be used on types (gcc)
4. A declaration expression as the first element of a `for` statement (C99)
5. The `restrict` qualifier and the `inline` specifier (C99)
6. Initialization designators (C99)
7. Array initialization designators can include ranges (gcc)
8. ANSI-style function definitions can be nested (gcc) (gcc also allows nested K&R-style function definitions)
9. The equals sign following an initializer designator is optional (gcc)
10. Array and structure initialization (gcc)
11. Compound literals (C99)
12. Declarations can be intermixed with statements (C99).
13. Recognise `__atribute__(__unused__)` for determining which identifiers should not be reported as unused (gcc).
14. `//` line comments (common extension)
15. `__asm__` blocks (gcc)
16. `enum` lists ending with a comma (common extension)
17. Anonymous `struct/union` members (gcc, Microsoft C)
18. Allow `case` expression ranges (gcc).
19. An enumeration list can be empty (Microsoft C)
20. Allow braces around scalar initializers (common extension).
21. Indirect `goto` targets and the label address-of operator (gcc).
22. `__typeof` keyword (gcc)
23. A compound statement in brackets can be an expression (gcc)
24. Macros expanding from `/##/` into `//` are then treated as a line comment (Microsoft C)
25. Exception handling using the `__try __except __finally __leave` keywords (Microsoft C)
26. `#include_next` preprocessor directive (gcc)
27. `#warning` preprocessor directive (gcc)
28. Variable number of arguments preprocessor macros (support for both the gcc and the C99 syntax)
29. Allow empty member declarations in aggregates (gcc)
30. `long long` type (common extension)
31. A semicolon can appear as a declatation (common extension)
32. An aggregate declaration body can be empty (gcc)
33. Aggregate member initialization using the member: value syntax (gcc)
34. Statement labels do not require a statement following them (gcc)
35. #ident preprocessor directive (gcc)
36. Allow assignment to case expressions (common extension)
37. Accept an empty translation unit (common extension).
38. Support locally declared labels (`__label__`) (gcc).
39. The second argument of a conditional expression can be omitted (gcc).
40. Dereferencing a function yields a function (common extension).

Many other compiler-specific extensions are handled by suitable macro definitions in the CScout initialization file.

Contents | « Previous Next (Processing Yacc Files) »