Describe the bug
The -transpile flag does not transfer over global variables
To Reproduce
Steps to reproduce the behavior:
- Run
hcc -transpile file.hc | gcc -x c -
- Receive error pertaining to missing global
Example Program
U64 *memo;
U64 Fib(U64 n){
if(n < 2){
return 1;
}
if (memo[n] != 0){
return memo[n];
}
memo[n] = Fib(n-1) + Fib(n-2);
return memo[n];
}
U0 Main(I32 argc, U8 **argv){
memo = MAlloc(sizeof(U64)*101);
"%llu\n",Fib(100);
Free(memo);
}
Expected behavior
Globals should be present in the transpiled C code.
Compiler version
hcc beta-v0.0.9
binary: /usr/local/hcc
commit-hash: fd2d410
arch: Linux x86_64
build: Release
Desktop (please complete the following information):
Describe the bug
The
-transpileflag does not transfer over global variablesTo Reproduce
Steps to reproduce the behavior:
hcc -transpile file.hc | gcc -x c -Example Program
Expected behavior
Globals should be present in the transpiled C code.
Compiler version
hcc beta-v0.0.9
binary: /usr/local/hcc
commit-hash: fd2d410
arch: Linux x86_64
build: Release
Desktop (please complete the following information):