C99 Compliance Status

February 3, 2026 ยท View on GitHub

shecc implements a subset of C99 suitable for self-hosting and systems programming, prioritizing simplicity, educational value, and minimal dependencies over full standard compliance. This document tracks compliance gaps and non-standard behaviors.

Implemented Features

Core Language

  • Basic types: int, short, char, void, _Bool
  • Structures and unions with nested definitions
  • Enumerations with automatic value assignment
  • Function definitions and declarations
  • Arrays (single and multi-dimensional)
  • Pointers and pointer arithmetic (fully C99-compliant)
  • Type definitions (typedef)

Control Flow

  • if/else statements
  • goto and label statements
  • while, do-while, for loops
  • switch/case/default statements
  • break, continue, return statements

Operators

  • Arithmetic: +, -, *, /, %
  • Bitwise: &, |, ^, ~, <<, >>
  • Logical: &&, ||, !
  • Relational: <, >, <=, >=, ==, !=
  • Assignment: =, +=, -=, *=, /=, %=, <<=, >>=, &=, |=, ^=
  • Increment/decrement: ++, -- (prefix and postfix)
  • Conditional: ? :
  • Member access: ., ->
  • Address/dereference: &, *

Preprocessor (Partial)

  • #define for object-like and function-like macros
  • #ifdef, #ifndef, #if, #elif, #else, #endif
  • #undef for macro removal
  • #pragma once, other #pragma options will be ignored
  • defined() operator
  • __VA_ARGS__ for variadic macros
  • __FILE__, __LINE__ built-in macros

Missing Features

Storage Classes & Qualifiers

FeatureStatusImpact
staticNot implementedNo internal linkage or persistent local variables
externNot implementedNo external linkage declarations
registerNot implementedNo register hint optimization
autoNot implementedDefault storage class (implicit)
constParsed but ignoredNo read-only enforcement
volatileNot implementedNo volatile semantics
restrictNot implementedNo pointer aliasing optimization
inlineNot implementedNo function inlining

Type System

FeatureStatusNotes
longMissingOnly 4-byte integers
long longMissingNo 64-bit integers
unsignedMissingAll integers are signed
signedMissingImplicit for integers
floatMissingNo floating-point support
doubleMissingNo floating-point support
long doubleMissingNo floating-point support
Bit-fieldsMissingCannot pack struct members

Literals & Constants

FeatureStatusCurrent Behavior
Integer suffixes (u, l, ll)Not parsedAll literals are int
Wide characters (L'c')Not supportedSingle-byte only
Wide strings (L"...")Not supportedSingle-byte only
Multi-character constantsNot supportedSingle character only
Universal characters (\u, \U)Not supportedASCII only
Hex escapes (\x...)LimitedMax 2 hex digits

Preprocessor Gaps

FeatureStatusDescription
#includePartialLocal file inclusion is supported, but lack of capability to include system files
Token pasting (##)MissingCannot concatenate tokens
Stringizing (#)MissingCannot convert to string
__DATE__MissingNo compile date
__TIME__MissingNo compile time
__STDC__MissingNo standard compliance indicator

Advanced Features

FeatureStatusDescription
Designated initializersMissingNo .field = value syntax
Compound literalsPartialLimited support
Flexible array membersMissingNo [] at struct end
Variable-length arraysMissingNo runtime-sized arrays
_ComplexMissingNo complex numbers
_ImaginaryMissingNo imaginary numbers
_Static_assertMissingNo compile-time assertions
_AlignofMissingNo alignment queries
_AlignasMissingNo alignment specification
_GenericMissingNo generic selection

Non-Standard Behaviors

GNU Extensions

  • Binary literals: 0b101010
  • Escape sequence: \e for ESC character
  • void* arithmetic (treated as char*)
  • sizeof(void) returns 0 (should be error)
  • Computed goto

Implementation-Specific

  • Array compound literals in scalar context use first element
  • String literals are modifiable (stored in .data, not .rodata)
  • No strict aliasing rules
  • Left-to-right evaluation order (not always guaranteed in C99)