PBXB64 supports a growing C17 subset interoperable with B64/BASIC/PILOT through the unified IR. V10 adds printf/varargs, indirect function pointers, and float arithmetic.
PBXB64 supports a growing C17 subset interoperable with B64/BASIC/PILOT through the unified IR. V10 adds printf/varargs, indirect function pointers, and float arithmetic.
#include <stdio.h>Bootstrap printf with string-literal format:
#include <stdio.h>
int main(void) {
int n = 42;
printf("V10 answer=%d hex=%x str=%s\n", n, n, "ok");
return 0;
}
| Format | Support |
|---|---|
%d, %i | Signed integer |
%u | Unsigned integer |
%x, %X | Hexadecimal |
%o | Octal |
%c | Character |
%s | String |
%% | Literal percent |
call r/m64 via x64 backendlong long add(long long a, long long b) { return a + b; }
long long sub(long long a, long long b) { return a - b; }
int main(void) {
long long (*fp)(long long, long long);
int res = 0;
fp = &add;
res = (int)fp(20, 22);
fp = ⊂
return res + (int)fp(50, 8) - 84;
}
#include <stdlib.h>
int main(void) {
int* p = (int*)malloc(sizeof(int));
if (p) { *p = 42; free(p); }
return 0;
}
double f(double a, double b) {
return a * 2.0 + b / 4.0;
}
#define MAX 100
#if MAX > 50
#define MODE 1
#endif
#ifdef __STDC__
int ver = __STDC_VERSION__; // 201710L
#endif
_Pragma("GCC diagnostic ignored") // stripped safely
int line = __LINE__; // integer
char* file = __FILE__; // string literal
26 headers at core/include/c17/. Include with -I:
PBXB64 -I core/include/c17 program.c -o program.exe
switch (x) { case 1: break; case 2: case 3: break; default: break; }
goto label; label: return 0;
return (x > 0) ? 1 : -1;
for (int i = 0; i < 10; i++, j += 2) { body }
if (x) { block } else { block }