From ac0ef2f47ebecb14ef250eef574b1521117c4add Mon Sep 17 00:00:00 2001 From: ivarne Date: Thu, 11 Dec 2014 21:30:36 +0100 Subject: [PATCH] Small cleanup of the depwarn flag for @-deprecated --- base/deprecated.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index 80f8e239dd64c..3e7cbd3efcf8b 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -36,15 +36,15 @@ macro deprecate(old,new) end function depwarn(msg, funcsym) + # don't warn about deprecations if --no-depwarn is specified + compileropts().no_depwarn == 0 && return bt = backtrace() caller = firstcaller(bt, 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)