diff --git a/Makefile b/Makefile index 1a615909c7..855f91559b 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ else $(V) self endif else - $(CC) $(CFLAGS) -g -std=gnu11 -w -o $(V) $(VC)/$(VCFILE) $(LDFLAGS) -lm -lpthread + $(CC) $(CFLAGS) -g -std=gnu99 -w -o $(V) $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS) ifdef ANDROID chmod 755 v endif diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 6d1ddf7a97..4d4e10b511 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -155,7 +155,7 @@ fn (mut v Builder) cc() { // '-Werror', // TODO : try and remove the below workaround options when the corresponding // warnings are totally fixed/removed - mut args := [v.pref.cflags, '-std=gnu11', '-Wall', '-Wextra', '-Wno-unused-variable', '-Wno-unused-parameter', + mut args := [v.pref.cflags, '-std=gnu99', '-Wall', '-Wextra', '-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-result', '-Wno-unused-function', '-Wno-missing-braces', '-Wno-unused-label'] if v.pref.os == .ios { args << '-framework Foundation' @@ -448,7 +448,9 @@ fn (mut v Builder) cc() { if !v.pref.is_bare && v.pref.os == .js && os.user_os() == 'linux' { linker_flags << '-lm' } - str_args := args.join(' ') + ' ' + linker_flags.join(' ') + env_cflags := os.getenv('CFLAGS') + env_ldflags := os.getenv('LDFLAGS') + str_args := env_cflags + ' ' + args.join(' ') + ' ' + linker_flags.join(' ') + ' ' + env_ldflags if v.pref.is_verbose { println('cc args=$str_args') println(args)