A BSW message indicates that a function in your program is about to write beyond the stack pointer.
A BSW message is commonly caused by a function returning a pointer to a local variable that has gone out of scope. If the caller attempts to use that variable, it can result in a BSW error. To keep the value valid after the called function returns, make such variables static.
Note:
Unlike other write errors, such as an ABW, this is not a corrupting error, since it is always legal to write a value beyond the end of the stack. However, values beyond the current stack pointer are subject to change without notice. For example, if your program takes a context switch or a signal, the value written by this access might not be reliably re-read.