diff --git a/compiler/cc.v b/compiler/cc.v index 913b0da19d..3593fe1700 100644 --- a/compiler/cc.v +++ b/compiler/cc.v @@ -119,16 +119,17 @@ fn (v mut V) cc() { a << '-mmacosx-version-min=10.7' } cflags := v.get_os_cflags() - // add all flags (-I -l -L etc) not .o files - for flag in cflags { - if flag.value.ends_with('.o') { continue } - a << flag.format() - } // add .o files for flag in cflags { if !flag.value.ends_with('.o') { continue } a << flag.format() } + // add all flags (-I -l -L etc) not .o files + for flag in cflags { + if flag.value.ends_with('.o') { continue } + a << flag.format() + } + a << libs // Without these libs compilation will fail on Linux // || os.user_os() == 'linux' diff --git a/compiler/parser.v b/compiler/parser.v index 449d6b2d8b..20ecd0ac0f 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -2348,11 +2348,7 @@ fn (p mut Parser) factor() string { p.fgen('sizeof(') p.next() p.check(.lpar) - mut sizeof_typ := p.get_type() - if sizeof_typ.ends_with('*') { - // Move * from the end to the beginning, as C requires - sizeof_typ = '*' + sizeof_typ.left(sizeof_typ.len - 1) - } + mut sizeof_typ := p.get_type() p.check(.rpar) p.gen('$sizeof_typ)') p.fgen('$sizeof_typ)')