cgen/builder: make unused-command-line-argument a warning & cgen module_built fix

pull/7467/head
joe-conigliaro 2020-12-22 19:21:05 +11:00
parent fc251a653e
commit dd27d0a2a3
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
2 changed files with 7 additions and 7 deletions

View File

@ -194,7 +194,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
'-Wcast-qual', '-Wdate-time', '-Wduplicated-branches', '-Wduplicated-cond', '-Wformat=2', '-Winit-self',
'-Winvalid-pch', '-Wjump-misses-init', '-Wlogical-op', '-Wmultichar', '-Wnested-externs', '-Wnull-dereference',
'-Wpacked', '-Wpointer-arith', '-Wshadow', '-Wswitch-default', '-Wswitch-enum', '-Wno-unused-parameter',
'-Wno-unknown-warning-option', '-Wno-format-nonliteral']
'-Wno-unknown-warning-option', '-Wno-format-nonliteral', '-Wno-unused-command-line-argument']
if v.pref.os == .ios {
ccoptions.args << '-framework Foundation'
ccoptions.args << '-framework UIKit'

View File

@ -144,12 +144,12 @@ pub fn cgen(files []ast.File, table &table.Table, pref &pref.Preferences) string
if pref.build_mode == .build_module {
// TODO: detect this properly for all cases
// either get if from an earlier stage or use the lookup paths
if pref.path.contains('vlib' + os.path_separator) {
module_built = pref.path.after('vlib' + os.path_separator).replace(os.path_separator,
'.')
} else if pref.path.contains('.vmodules' + os.path_separator) {
module_built = pref.path.after('.vmodules' + os.path_separator).replace(os.path_separator,
'.')
for dir_name in ['vlib', '.vmodules', 'modules'] {
if pref.path.contains(dir_name + os.path_separator) {
module_built = pref.path.after(dir_name + os.path_separator).replace(os.path_separator,
'.')
break
}
}
}
mut timers_should_print := false