Re: Possible Bug in 4.0 with warning()
- Posted by CChris Aug 11, 2008
- 845 views
DerekParnell said...
twbeaty said...
but the warning still appears at the end of the run
I think this is because warning() is a parse-time operation and not a run-time operation. This means that if the file contains a warning anywhere (and that is not excluded because of an ifdef statement), it gets added to the list of warnings that is displayed at program end. This happen regardless of whether or not the warning() is in the execution path.
Well, this is true only after dead ifdef branches are removed. An ifdef'ed out warning() never fires.
CChris
DerekParnell said...
If you need to provide a run-time message, then you still do that the traditional way.
export function eqtQuadIntToSequence(integer count, atom ptr) if (count < 1) or (count > 4) then printf(2, "WARNING: eqtQuadIntToSequence(%d,%g): Parameter \"count\" out of range.", {count,ptr}) if count < 1 then count = 1 else count = 4 end if end if return peek4u({ptr, count}) end function