ci: fix `clang -std=c99 -D_DEFAULT_SOURCE -o v vc/v.c` warnings

pull/11187/head
Delyan Angelov 2021-08-15 11:12:48 +03:00
parent eef7eea7bc
commit 6843b85063
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 5 additions and 3 deletions

View File

@ -188,7 +188,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
// arguments for the C compiler
ccoptions.args = [v.pref.cflags]
if !v.pref.no_std {
ccoptions.args << '-std=c99'
ccoptions.args << '-std=c99 -D_DEFAULT_SOURCE'
}
ccoptions.wargs = [
'-Wall',

View File

@ -519,6 +519,8 @@ pub fn find_all_v_files(roots []string) ?[]string {
// if you add another cached unsafe function using static, do not forget to add
// a mechanism to clear its cache, and call it here.
pub fn free_caches() {
unsafe { cached_read_source_file('') or {} }
unsafe { cached_file2sourcelines('') }
unsafe {
cached_file2sourcelines('')
cached_read_source_file('') or { '' }
}
}