jserv / MazuCC

A minimalist C compiler with x86_64 code generation
BSD 2-Clause "Simplified" License
516 stars 64 forks source link

Passing structs with size > 8 throws "Unknown data size" error #12

Open vasyop opened 5 years ago

yetingk commented 5 years ago

Could you tell me what the code you input to MazuCC? I have a different result, my command like that:

$ cat sample/test.c
struct abcd {
    int a;
    int b;
    int c;
    int d;
} abcd;
$ ./mzcc < sample/test.c
.data                # emit_data_section:724
.lcomm abcd, 16      # emit_global_var -> emit_bss:709
vasyop commented 5 years ago

try passing an instance (not a pointer) of abcd to a function

yetingk commented 5 years ago

Thanks, I got it.