@@ -277,8 +277,10 @@ pub fn (mut v Builder) cc_msvc() {
277277 // `-w` no warnings
278278 // `/we4013` 2 unicode defines, see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4013?redirectedfrom=MSDN&view=msvc-170
279279 // `/volatile:ms` enables atomic volatile (gcc _Atomic)
280- // `/F 16777216` changes the stack size to 16MB, see https://docs.microsoft.com/en-us/cpp/build/reference/f-set-stack-size?view=msvc-170
281- a << ['-w' , '/we4013' , '/volatile:ms' , '/F 16777216' ]
280+ // `/F33554432` changes the stack size to 32MB, see https://docs.microsoft.com/en-us/cpp/build/reference/f-set-stack-size?view=msvc-170
281+ // Note: passing `/FNUMBER` is preferable to `/F NUMBER` for unix shells like bash or in cygwin, that otherwise may treat the `/F` as a folder,
282+ // if there is an F: drive in the system (they map c: as /c/, d: as /d/ etc)
283+ a << ['-w' , '/we4013' , '/volatile:ms' , '/F33554432' ]
282284 if v.pref.is_prod && ! v.pref.no_prod_options {
283285 a << '/O2'
284286 }
@@ -387,7 +389,7 @@ pub fn (mut v Builder) cc_msvc() {
387389 a << v.pref.ldflags.trim_space ()
388390 }
389391 v.dump_c_options (a)
390- args := '\xEF\xBB\xBF ' + a.join (' ' )
392+ args := '\xEF\xBB\xBF ' + a.join (' ' ) // write a BOM to indicate the utf8 encoding of the file
391393 // write args to a file so that we dont smash createprocess
392394 os.write_file (out_name_cmd_line, args) or {
393395 verror ('Unable to write response file to "${out_name_cmd_line} "' )
0 commit comments