Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.63 KB

File metadata and controls

31 lines (26 loc) · 1.63 KB

Supported C Features

The Aburiscript compiler provides robust support for the standard C language, aiming for compliance with C99/C11 while supporting several common GNU/Clang/Apple extensions.

Core Language Features

  • Control Flow: if, else, while, do-while, for, switch, case, break, continue, goto, and return.
  • Data Types:
    • Standard integers (char, short, int, long, long long) with signed/unsigned modifiers.
    • Floating-point types (float, double).
    • Pointers, multidimensional arrays, and function pointers.
  • Complex Types:
    • struct and union declarations, including bitfields.
    • enum declarations.
  • Functions: Variadic functions (...) utilizing stdarg.h / __builtin_va_*.

C99 Features

  • Compound Literals: e.g., (struct Point){1, 2}.
  • Designated Initializers: e.g., struct Config c = { .timeout = 10, .url = "localhost" };.
  • Variable Length Arrays (VLAs): Arrays whose size is determined at runtime.
  • Complex Numbers: _Complex type and __real__ / __imag__ extraction.

C11 Features

  • _Static_assert for compile-time assertions.
  • _Thread_local for thread-local storage duration.
  • _Alignas for memory alignment specifications.

Compiler Extensions

  • Apple Blocks: Support for closures using the ^ syntax and the __block storage specifier.
  • Attributes: GNU-style __attribute__((...)) for features like packed and always_inline.
  • Builtins: Native compiler built-ins such as __builtin_offsetof and __builtin_types_compatible_p.
  • Inline Assembly: Support for inline asm() statements with constraints.