QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Cobalt on November 30, 2021, 11:41:45 am
-
So I can stop running into this:
In file included from qbx.cpp:2185:
..\\temp\\main.txt: In function 'void SUB_SAVE_IT(qbs*)':
..\\temp\\main.txt:3329:137: error: lvalue required as unary '&' operand
sub_put(qbr(*_SUB_SAVE_IT_SINGLE_F),NULL,byte_element((uint64)(&(qbs_new_fixed(&((uint8*)(__ARRAY_STRING255_DIALOGS[0]))[(0)*255],255,1))),(255*(__ARRAY_STRING255_DIALOGS[2]&1)*__ARRAY_STRING255_DIALOGS[5])-(255*(0)),byte_element_118),0);
compilation terminated due to -Wfatal-errors.
-
I think @SMcNeill had mentioned it several months ago with a possible fix but I think it broke other things.
-
You don't mention what version of QB64 you're using there, Cobalt. Is it the latest?
-
Also, if you can, please provide a minimal reproducible sample snippet we can use to check the issue.
-
It's been discussed before a few times, looks like:
https://www.qb64.org/forum/index.php?topic=3974.msg133138#msg133138 (https://www.qb64.org/forum/index.php?topic=3974.msg133138#msg133138)
https://www.qb64.org/forum/index.php?topic=3347.msg126452#msg126452 (https://www.qb64.org/forum/index.php?topic=3347.msg126452#msg126452)
https://www.qb64.org/forum/index.php?topic=1471.msg106707#msg106707 (https://www.qb64.org/forum/index.php?topic=1471.msg106707#msg106707)
-
That's a good example of why reporting issues in the forum alone and not creating an issue in the repository is prone to leave bugs behind.
https://github.com/QB64Team/qb64/issues/new/choose
-
You don't mention what version of QB64 you're using there, Cobalt. Is it the latest?
Well it was more of an open-ended question. but yes latest build(stable) 2.0.2
PUT #1, , A
() 'GET #1 causes the same issue
That's a good example of why reporting issues in the forum alone and not creating an issue in the repository is prone to leave bugs behind.
But you know how much GIT loves me. *sarcasm sarcasm*
I will see if it will allow me to though.
It's been discussed before a few times, looks like:
That is true, but yet no definitive repair was presented. And while the simple FOR\NEXT approach works, its just an inconvenience to have to when other data types don't need such excess code to be saved or read.
-
Yeah, like I was saying; I know Steve had discussed a fix in the C++ code but I don't think it was going to work out in the long term. I want to say I've seen Luke talk about it in the Discord as well but I don't know what ended up happening with that.
-
Aye. You can go in and alter the translated code in internal/temp manually with my "fix", but we can't push it into the repo as it breaks other things if applied across the board. If I could sort out where in QB64 we generate the appropriate code for the c translation, I could probably write an IF condition to toggle translation between the two outputs, but I haven't had time (or honestly, motivation) to try and dig deep into the internals and push for the issue.
And for those who don't understand WHY this is such a complex bug to sort out, here's one of the machine translated PUT statements:
sub_put( 1 , 1 ,byte_element((uint64)(&(qbs_new_fixed(&((uint8*)(__ARRAY_STRING1_B[0]))[(0)*1],1,1))),(1*(__ARRAY_STRING1_B[2]&1)*__ARRAY_STRING1_B[5])-(1*(0)),byte_element_1),1);
The issue is with a stray & in there. Oddly enough, from what I remember with the issue, removing it fixes so we can PUT #1, , array(), but it breaks PUT #1, , array(element), which we can do now.
Which is why their needs to be a toggle in the output, but I'll be damned if I can sort out where to PUT it inside QB64's internals.
-
Is now a GItHub Issue.
#211
-
I posted a reply on GIT, but I wanted to place it here, just in case putting it in GIT was the wrong place to do so.
The code below does what you want it to, just replace the BINARY and PUT with OUTPUT and PRINT.
B$ = ""
B$ = B$ + "A"
B$ = B$ + "ZZZZZ"
A(I) = B$
-
@SMcNeill
It is very impressive how so far from human language is that translation!
So our translator into C++ is not a real translator to pure C++ but a script writer that translate QB64 code into script calling BAS. CPP library.
I hope and pray for all you developers that Rob has left you a map of his library.
It is hard to walk blind in the city!
Good luck boys.