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