diff --git a/base/deprecated.jl b/base/deprecated.jl index 8fec33f7dbd9e..60d3d37343a0a 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -38,7 +38,10 @@ function depwarn(msg, funcsym) warn(msg, once=(caller!=C_NULL), key=caller, bt=bt) end +shouldwarn() = (opts = compileropts(); bool(opts.depwarn)) + function firstcaller(bt::Array{Ptr{Void},1}, funcsym::Symbol) + !shouldwarn() && return C_NULL # Identify the calling line i = 1 while i <= length(bt) diff --git a/base/util.jl b/base/util.jl index 2ceffd09ac738..8b61176b9fb75 100644 --- a/base/util.jl +++ b/base/util.jl @@ -242,7 +242,7 @@ end warn(err::Exception; prefix="ERROR: ", kw...) = warn(sprint(io->showerror(io,err)), prefix=prefix; kw...) -# Julia compiler options struct +# Julia compiler options struct (see jl_compileropts_t in src/julia.h) immutable JLCompilerOpts build_path::Ptr{Cchar} code_coverage::Int8 diff --git a/ui/repl.c b/ui/repl.c index 74a23da8a316c..aaee1869922e3 100644 --- a/ui/repl.c +++ b/ui/repl.c @@ -88,7 +88,7 @@ static const char *opts = " -O, --optimize Run time-intensive code optimizations\n" " --int-literals={32|64} Select integer literal size independent of platform\n" " --dump-bitcode={yes|no} Dump bitcode for the system image (used with --build)\n" - " --no-depwarn Turn off deprecated syntax warnings\n"; + " --no-depwarn Turn off syntax and method deprecation warnings\n"; void parse_opts(int *argcp, char ***argvp) {