C Language Reference (C17 Subset)

PBXB64 supports a controlled C17 subset interoperable with B64/PB/PILOT through the unified IR. V8 adds full preprocessor, runtime control flow, and 26 standard headers. V9 hardens preprocessor corner cases, adds function pointers, and strengthens runtime aliases.

Preprocessor (V8/V9 Full Support)

V8/V9 adds complete C preprocessor support
#define MAX 100
#define ADD(a,b) ((a)+(b))

#if MAX > 50
    int x = 1;
#elif defined(DEBUG)
    int x = 2;
#else
    int x = 3;
#endif

#ifdef __STDC__
    int ver = __STDC_VERSION__;  // 201710L
#endif

// Stringification and token paste
#define STR(x) #x
#define CAT(a,b) a##b
DirectiveV8/V9 Support
#define / #undefObject-like and function-like macros
#if / #ifdef / #ifndefFull expression evaluation (+ - * / % << >> & ^ |)
#elif / #else / #endifNested conditionals
#includeLocal and system headers
#errorDiagnostic messages
# / ##Stringification and token paste
Variadic macros__VA_ARGS__
_Pragma / #pragmaAccepted/ignored, stripped during expansion (V9)
#lineCompatibility directive accepted (V9)
__FILE__ / __LINE__Predefined string/integer macros (V9)

C17 Standard Headers (V8/V9)

26 C17 headers available at core/include/c17/. Include with -I flag:

PBXB64 -I core/include/c17 program.c -o program.exe
stdio.hstdlib.hstring.hstdint.h
stddef.hstdbool.hstdalign.hstdarg.h
limits.hfloat.hmath.hctype.h
assert.herrno.htime.hinttypes.h
fenv.hiso646.hlocale.hsetjmp.h
signal.hstdatomic.hstdnoreturn.hthreads.h
tgmath.hwchar.hwctype.huchar.h

V9 Runtime & Function Pointers

V9 adds native runtime aliases and simple function-pointer calls:
// Simple direct function pointer call (V9)
long long add(long long a, long long b) { return a + b; }
int main(void) {
    long long (*fp)(long long, long long) = &add;
    return (int)fp(20, 22);
}

// Runtime aliases (V9)
void* p = malloc(100);   // Maps to KERNEL32 HeapAlloc
free(p);                 // Maps to KERNEL32 HeapFree
size_t len = strlen(s);  // Native bestof implementation

Control Flow (V8)

// switch/case with fallthrough
switch (x) {
    case 1: do_something(); break;
    case 2:
    case 3: do_other();    // intentional fallthrough
        break;
    default: break;
}

// goto/labels
if (x) goto label;
label: return 0;

// ternary operator
return (x > 0) ? 1 : -1;

// multi-increment for loop
for (int i = 0; i < 10; i++, j += 2) {
    body
}

Language Features (V8/V9)

FeatureStatus
_Static_assertInteger constant expressions
_AlignofBootstrap handling
sizeofType and expression forms
unionParsing and layout (V9 shell)
Function pointer typedefsDeclarations, address-of, direct calls (V9)
Bitfield-bearing structsBodies parsed/skipped safely (V9)
Octal integer constantsSupported
Adjacent string literalsCovered cases
Backslash-newline splicingPreprocessor phase
Known C17 Gaps: Not full hosted C17. No windows.h, no complete floating-point guarantee, no varargs ABI/runtime (planned V11), no indirect function-pointer calls beyond local direct targets, no complex/atomics/threads/fenv depth.