Skip to content

Commit

Permalink
Small cleanup of the depwarn flag for @-deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarne committed Dec 11, 2014
1 parent 1ca287f commit ac0ef2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ac0ef2f

Please sign in to comment.