Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
This method, of course, will help. But, it may require during porting lot of code changes: poiters, passing arguments to functions, etc. It turned out that the error occurs only for debug version with compiler option-O0. In the case of optimization -01 or- 02 there is no error. I think that is oblivious compiler bug.