Errors in OSLibSupport.X.c.X

Stewart Brodie stewart.brodie at pace.co.uk
Mon Jul 23 09:57:20 BST 2001


In message <E15ONNR-0002dJ-00 at bfg.reinhouse.freeserve.co.uk>
          Timothy Baldwin <tim at reinhouse.freeserve.co.uk> wrote:

> In OSLibSupport.X.c.X there is:
> 
> /* synchronisation error */ x_LOCAL_ERROR( Error_Sync, 1 + 1U<<30,
> "Try/Catch Synchronisation Error" );
> 
> /* exception stack overflow */ x_LOCAL_ERROR( Error_XStack, 2 + 1U<<30,
> "Too many nested x_TRY blocks" );
> 
> which would define a couple of serious errors.
> 
> Addition has higher precedence than shifts, so should that not be:
> 
> /* synchronisation error */ x_LOCAL_ERROR( Error_Sync, 1 + (1U<<30),
> "Try/Catch Synchronisation Error" );
> 
> /* exception stack overflow */ x_LOCAL_ERROR( Error_XStack, 2 + (1U<<30),
> "Too many nested x_TRY blocks" );
> 
> 
> i.e. with brackets around 1U<<30
> 
> PS. spotted this with gcc-Wall

Is it possible that this expression used to use bitwise or and not addition
and that's why it is now wrong?

-- 
Stewart Brodie, Senior Software Engineer    (Views expressed are my own and
Pace Micro Technology PLC                   not those of my employer)
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/



More information about the oslib-user mailing list