[futurebasic] RE: [FB] FBToC 1.4.8 compiling bug

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2010 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Mon, 29 Nov 2010 10:53:08 -0600
Ooops, just returned from holiday and I see there is already a solution to your problem.


W.

-----Original Message-----
From: futurebasic@... [mailto:futurebasic@...] On Behalf Of Robert Purves
Sent: Monday, November 22, 2010 4:47 PM
To: futurebasic@...
Subject: Re: [FB] FBToC 1.4.8 compiling bug


Carminati Paolo wrote:

> Try to compile the following:
> 
> dim as byte   buffer(1024)
> 
> local
> local fn ReadBytes ( bytesToRead as unsigned byte, thePtr as ptr )
> end fn
> 
> if (fn ReadBytes ( 2, @buffer )) then beep
> end
> 
> It  will crash...
> Note that if the calling routine isn't in the "if" statement, it doesn't crash.
> In other words, fn ReadBytes( 2, @buffer ) doesn't crash and the correct error is reported.

Thanks, Paolo. I filed a bug report.

FWIW, a pointer to the start of the array is obtained in FB with @buffer(0).
  if ( fn ReadBytes( 2, @buffer(0) ) ) then beep

In C, but not FB, buffer is variable that points to the start of the array.

Robert P.

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...