Errors in OSLibSupport.X.c.X

Tony van der Hoff tony at mk-net.demon.co.uk
Mon Jul 23 10:25:40 BST 2001


On 23 Jul 2001, in message <d79f7f9e4a.sbrodie at sbrodie.cam.pace.co.uk>,
Stewart Brodie <stewart.brodie at pace.co.uk> wrote:

> 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
> 
Thanks for that Timothy. Corrected for the next release.

> Is it possible that this expression used to use bitwise or and not addition
> and that's why it is now wrong?
> 
Very generous of you to give me the benefit of doubt, Stewart, but the plain
truth is, I cocked up. Thanks anyway :-)


-- 
Tony van der Hoff         | MailTo:tony at mk-net.demon.co.uk
                          | MailTo:avanderhoff at iee.org
Buckinghamshire, England  | http:www.mk-net.demon.co.uk



More information about the oslib-user mailing list