Hi, see the attched gif file. The project build seems to be successfull while the linking failed.
(v3.50 bèta.)
Confirmed solved in mP v3.80.
Unsuccessfull linking but successfull finishing [Solved]
Unsuccessfull linking but successfull finishing [Solved]
Last edited by Dany on 14 May 2010 21:33, edited 3 times in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: Unsuccessfull linking but successfull finishing?
I have similar errors with v2.50 when I've tried to have one procedural var call another procedural var - something that's apparently not possible with this Pascal and which is a complete project show-stopper for me.
A trivial demo example:
(there's nothing fancy going on in either of the used units: it's all basic stuff)
This is possible in FreePascal and Delphi, and I'm surprised it's not possible here.
The error message is bogus because there's NO cross-calling and in any case, surely the only limits in play should be those applying to the use of any procedures - whether compiled as a conventional procedure and run directly through code or when a procedure's address is assigned to a procedural var.
To do otherwise makes for an uncomfortable imbalance and I'm disappointed that I seem to have been hit by a rather strange implementation limitation. The procedure address is still the procedure address even after it's been assigned to a var, right?, and I don't understand why the stack frame should (apparently) have to be handled differently depending on whether the procedure is called through a var or directly through code.
BTW (off-topic but loosely related): could the requirement for the trailing '^' at the end of a call by procedural var be dropped?
I guess it's technically correct to write the call as SomeProcVarName^ but writing just SomeProcVarName is more intuitive. IIRC an early release of Delphi had the same requirement but it was dropped in favour of the "unadorned" procedural var name.
edit:
( oops - a brainfart. I meant v3.20 of course...)
A trivial demo example:
Code: Select all
program ProcVarTest;
uses
LibInit,LibLCD4Bit; // set up MCU I/O and use my own LCD library
type
tProc=procedure;
var
ProcVar1,ProcVar2: ^tProc;
procedure Proc1;
begin
LCDWrite('this is Proc1')
end;
procedure Proc2;
begin
LCDWrite('this is Proc2');
// uncomment "ProcVar1^" line below and attempting to recompile
// gets the completely bogus error "Recursion or cross-calling of LCDWrite"
// (also for for Proc1), followed by "Not enough RAM for call stack"
// ProcVar1^
end;
begin
InitProject;
LCDWrite('Hello World');
ProcVar1:=@Proc1;
ProcVar2:=@Proc2;
ProcVar1^;
ProcVar2^
end.
This is possible in FreePascal and Delphi, and I'm surprised it's not possible here.
The error message is bogus because there's NO cross-calling and in any case, surely the only limits in play should be those applying to the use of any procedures - whether compiled as a conventional procedure and run directly through code or when a procedure's address is assigned to a procedural var.
To do otherwise makes for an uncomfortable imbalance and I'm disappointed that I seem to have been hit by a rather strange implementation limitation. The procedure address is still the procedure address even after it's been assigned to a var, right?, and I don't understand why the stack frame should (apparently) have to be handled differently depending on whether the procedure is called through a var or directly through code.
BTW (off-topic but loosely related): could the requirement for the trailing '^' at the end of a call by procedural var be dropped?
I guess it's technically correct to write the call as SomeProcVarName^ but writing just SomeProcVarName is more intuitive. IIRC an early release of Delphi had the same requirement but it was dropped in favour of the "unadorned" procedural var name.
edit:
( oops - a brainfart. I meant v3.20 of course...)
Last edited by Bryn on 06 May 2010 17:12, edited 1 time in total.
To err is human; to moo, bovine.
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Unsuccessfull linking but successfull finishing?
Hi Dany and Bryn!
Dany:
Please, send me your project. I would like to reproduce your problem and inform our developers about it.
You can send it to my email: slavisa.zlatanovic@mikroe.com
Bryn:
I'll try to reproduce your problem and get back to you later.
Best regards
Slavisa
Dany:
Please, send me your project. I would like to reproduce your problem and inform our developers about it.
You can send it to my email: slavisa.zlatanovic@mikroe.com
Bryn:
I'll try to reproduce your problem and get back to you later.
Best regards
Slavisa
Best regards
Slavisa
Slavisa
Re: Unsuccessfull linking but successfull finishing?
Hi Slavisa, I can not send the actual project to you (it is not mine), but I will try to simulate a project where compiling succeeds and linking fails...slavisa.zlatanovic wrote:Please, send me your project. I would like to reproduce your problem and inform our developers about it.
(I assume you can make this type of project as well).
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: Unsuccessfull linking but successfull finishing?
Many thanks, Slavisa.slavisa.zlatanovic wrote:Bryn:
I'll try to reproduce your problem and get back to you later.
I really hope this can be nailed ASAP and procedure calls end up being treated identically - irrespective of whether they're called directly or via their address in a variable.
To err is human; to moo, bovine.
Re: Unsuccessfull linking but successfull finishing?
Hi Slavisa, one can force a failed linking by declaring a too large array with respect to the ram size of the PIC and try to use that array. This gives an error of the linker: "not enough Ram", but the total project succeeds as in the first post.Dany wrote:Hi Slavisa, I can not send the actual project to you (it is not mine), but I will try to simulate a project where compiling succeeds and linking fails...slavisa.zlatanovic wrote:Please, send me your project. I would like to reproduce your problem and inform our developers about it.
(I assume you can make this type of project as well).
Extract from the logfile:
...
diagnostics: 0 134 Compiled Successfully C:\PIC Projects PRO compiler\Tests\Test Recursive Unit usage\TestRecursiveUnits.mpas
diagnostics: 0 139 All files Compiled in 120 ms
error: 5 362 Not enough RAM 'ttttt' unit3.mpas
error: 0 453 Unsuccessful linking 'TestRecursiveUnits.mpppi' Unsuccessful linking 'TestRecursiveUnits.mpppi'
diagnostics: 0 103 Finished successfully: 06 mei 2010, 20:21:03 TestRecursiveUnits.mpppi
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Unsuccessfull linking but successfull finishing?
Hi Bryn!
I couldn't reproduce your problem.
Please, send me your full project.
You can send it to my email: slavisa.zlatanovic@mikroe.com
Regards
I couldn't reproduce your problem.
Please, send me your full project.
You can send it to my email: slavisa.zlatanovic@mikroe.com
Regards
Best regards
Slavisa
Slavisa
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Unsuccessfull linking but successfull finishing?
Hi Dany!
I've reproduced the issue you're talking about. I'll inform our developers of it.
Thanks for reporting!
Regards
I've reproduced the issue you're talking about. I'll inform our developers of it.
Thanks for reporting!
Regards
Best regards
Slavisa
Slavisa
Re: Unsuccessfull linking but successfull finishing?
Ah... problem - it's for a client so not really all mine to give.slavisa.zlatanovic wrote:Please, send me your full project.
I'll strip it down to the absolute basics that still show the problem and get back to you.
Edit:
Done - a zip file is on its way to you.
Many thanks.
To err is human; to moo, bovine.
Re: Unsuccessfull linking but successfull finishing?
Confirmed solved in mP v3.80.slavisa.zlatanovic wrote:Hi Dany!
I've reproduced the issue you're talking about. I'll inform our developers of it.
Thanks for reporting!
Regards
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)