Is FreeBasic still continued to develop?
Oh sorry, I'm just mumbling ;)
Basically, the emitted C is breaking because it's trying to take the address of a returned value from a function. You can only do that (afaik) if the returned value is a reference. So we see here:
36 is calling your operator+, and 37 is trying to take the address of 36, but 36 is a function result. '&' is the 'take address' operator in C, like @ in FB. So that's why it says "invalid lvalue in unary `&' ", is because the 'lvalue' is a function result.
I'm not sure how to fix it, because if we create a temp var and assign it, then operator= gets called... I'm not sure if this is the correct behavior.
Edit: Actually it looks like that's what TMP$8$ may be for, as it's currently unused in the code. It just isn't hooked up, apparently.
Basically, the emitted C is breaking because it's trying to take the address of a returned value from a function. You can only do that (afaik) if the returned value is a reference. So we see here:
Code: Select all
#define vr$36 ((VECTOR2D)(_ZplR8VECTOR2DS0_( vr$35, vr$34 )))
#define vr$37 ((VECTOR2D*)(&vr$36))
#define vr$38 ((string*)(_ZN8VECTOR2Dcv8FBSTRINGEv( vr$37 )))
fb_PrintString( (integer)0, vr$38, (integer)1 );
I'm not sure how to fix it, because if we create a temp var and assign it, then operator= gets called... I'm not sure if this is the correct behavior.
Edit: Actually it looks like that's what TMP$8$ may be for, as it's currently unused in the code. It just isn't hooked up, apparently.
No problem, ;-) Your last post is clear.cha0s wrote:Oh sorry, I'm just mumbling ;)
To test Fbdebugger I use a "twisted" program so I guess that's also a good test for the gcc emitter. To go forward I'm going to put in comment the faulty line.
ok, no other problem.
What about a dedicated topic at the gcc emitter issues ?