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