diff --git a/NEWS.md b/NEWS.md index 7aeb6f927804d..33056d75d362e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -70,6 +70,12 @@ Language changes * The line number of function definitions is now added by the parser as an additional `LineNumberNode` at the start of each function body ([#35138]). +Command-line option changes +--------------------------- + +* Deprecation warnings are no longer shown by default. i.e. if the `--depwarn=...` flag is + not passed it defaults to `--depwarn=no`. ([#35362]). + * Color now defaults to on when stdout and stderr are TTYs ([#34347]) Multi-threading changes diff --git a/base/util.jl b/base/util.jl index 989af28d8d79a..5ee89c547086b 100644 --- a/base/util.jl +++ b/base/util.jl @@ -139,12 +139,12 @@ function julia_cmd(julia=joinpath(Sys.BINDIR::String, julia_exename())) end isempty(compile) || push!(addflags, "--compile=$compile") end - let depwarn = if opts.depwarn == 0 - "no" + let depwarn = if opts.depwarn == 1 + "yes" elseif opts.depwarn == 2 "error" else - "" # default = "yes" + "" # default = "no" end isempty(depwarn) || push!(addflags, "--depwarn=$depwarn") end diff --git a/src/jloptions.c b/src/jloptions.c index 9310645f2be80..a3cee4a4f9429 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -52,7 +52,7 @@ jl_options_t jl_options = { 0, // quiet 1, // debug_level [release build] #endif JL_OPTIONS_CHECK_BOUNDS_DEFAULT, // check_bounds - JL_OPTIONS_DEPWARN_ON, // deprecation warning + JL_OPTIONS_DEPWARN_OFF, // deprecation warning 0, // method overwrite warning 1, // can_inline JL_OPTIONS_POLLY_ON, // polly diff --git a/test/misc.jl b/test/misc.jl index f824694b45c52..2082d44905e7a 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -654,8 +654,9 @@ end include("testenv.jl") + let flags = Cmd(filter(a->!occursin("depwarn", a), collect(test_exeflags))) - local cmd = `$test_exename $flags deprecation_exec.jl` + local cmd = `$test_exename $flags --depwarn=yes deprecation_exec.jl` if !success(pipeline(cmd; stdout=stdout, stderr=stderr)) error("Deprecation test failed, cmd : $cmd")