diff --git a/vlib/compiler/cc.v b/vlib/compiler/cc.v index a71566ab59..b8da92e047 100644 --- a/vlib/compiler/cc.v +++ b/vlib/compiler/cc.v @@ -73,6 +73,20 @@ fn (v mut V) cc() { return } } + // arguments for the C compiler + mut a := [v.pref.cflags, '-std=gnu11', + '-Wall', + '-Wextra', + // TODO : activate -Werror once no warnings remain +// '-Werror', + // TODO : try and remove the below workaround options when the corresponding + // warnings are totally fixed/removed + '-Wno-unused-variable', + '-Wno-unused-but-set-variable', + '-Wno-unused-parameter', + '-Wno-unused-result', + '-Wno-missing-braces', + '-Wno-unused-label'] // TCC on Linux by default, unless -cc was provided // TODO if -cc = cc, TCC is still used, default compiler should be // used instead. @@ -95,6 +109,7 @@ fn (v mut V) cc() { //os.mkdir('/var/tmp/tcc/lib/tcc/') //os.create('/var/tmp/tcc/lib/tcc/libtcc1.a') v.pref.ccompiler = tcc_path + a << '-m64' } } } $else { @@ -103,20 +118,6 @@ fn (v mut V) cc() { } //linux_host := os.user_os() == 'linux' v.log('cc() isprod=$v.pref.is_prod outname=$v.out_name') - // arguments for the C compiler - mut a := [v.pref.cflags, '-std=gnu11', - '-Wall', - '-Wextra', - // TODO : activate -Werror once no warnings remain -// '-Werror', - // TODO : try and remove the below workaround options when the corresponding - // warnings are totally fixed/removed - '-Wno-unused-variable', - '-Wno-unused-but-set-variable', - '-Wno-unused-parameter', - '-Wno-unused-result', - '-Wno-missing-braces', - '-Wno-unused-label'] if v.pref.is_so { a << '-shared -fPIC '// -Wl,-z,defs'