unsigned long array problem with linux

Linux specific questions.
Post Reply
Sisophon2001
Posts: 1706
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

unsigned long array problem with linux

Post by Sisophon2001 »

Hi

This code is giving me problems, with the numbers in the unsigned range. The first number prints correctly, the second is wrong. It works correctly in windows.

I tested with FB-v015b-aug-27-testing-linux and CVS head.

Thanks

Garvan

Code: Select all

dim shared as unsigned long start_P (0 to 17) = { _
		&h243f6a88, &h85a308d3, &h13198a2e, &h03707344, _
		&ha4093822, &h299f31d0, &h082efa98, &hec4e6c89, _
		&h452821e6, &h38d01377, &hbe5466cf, &h34e90c6c, _
		&hc0ac29b7, &hc97c50dd, &h3f84d5b5, &hb5470917, _
		&h9216d5d9, &h8979fb1b _
		}

	for i = 0 to 17
		print start_P(i);" ";
	next
	sleep
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

Hi Garvan,
very strange thing.

I have test it with unsigned integer ERROR
with integer ERROR
with array and read data ERROR
with ponters too ERROR
in other order ERROR

This is an BUG.

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

Code: Select all

data  &h243f6a88, &h85a308d3, &h13198a2e, &h03707344
data  &ha4093822, &h299f31d0, &h082efa98, &hec4e6c89
data  &h452821e6, &h38d01377, &hbe5466cf, &h34e90c6c
data  &hc0ac29b7, &hc97c50dd, &h3f84d5b5, &hb5470917
data  &h9216d5d9, &h8979fb1b 
 
dim as uinteger ptr start_p
start_p=callocate(18 * 4)
for i = 0 to 17
  read start_p[i]
next

for i=0 to 17 
  print hex$(start_P[i]);" ";
next
sleep 
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

And the ERROR is with FB 0.15 from 25/SEP/2005 too.

Joshy
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Post by mjs »

I can reproduce this behaviour with the DOS and Cygwin versions too. I'll take a look at this ASAP.

EDIT: The current work-around is to add a "u" to all numbers >= &H80000000.

Example:

Code: Select all

dim shared as uinteger start_P (0 to 17) = { _
	&h243f6a88 , &h85a308d3u, &h13198a2e , &h03707344 , _
    &ha4093822u, &h299f31d0 , &h082efa98 , &hec4e6c89u, _
    &h452821e6 , &h38d01377 , &hbe5466cfu, &h34e90c6c , _
    &hc0ac29b7u, &hc97c50ddu, &h3f84d5b5 , &hb5470917u, _
    &h9216d5d9u, &h8979fb1bu _
}

for i = 0 to 17
	print right$("0000000" + hex$(start_P(i)),8),
next
print
sleep
Regards,
Mark
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Post by mjs »

Fixed, changes are in CVS.

Regards,
Mark
Sisophon2001
Posts: 1706
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

Post by Sisophon2001 »

Hi mjs

Thanks for your help. I seem to be having trouble with CVS update, so for now I will use your work around of adding a trailing u.

This is the message I get from CVS
can't create temporary directory /tmp/cvs-serv9827
Too many links
Error, CVS operation failed
I assume this is a server problem?

Thanks again

Garvan
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Post by mjs »

Hmm ... maybe but I cannot reproduce this error here ... but I don't use anonymous CVS like you ...

Regards,
Mark
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

Hello Garvan,
which for a coincidence i tried the whole night out different CVS clients with WINDOWS
and got exactly the same error message.

I was thinking the error came from the local pc and created an extra tmp folder. Image
But now it must be an problem on cvs.sf.net.

Joshy
Post Reply