Recent

Author Topic: [Answered] Inline not working in trunk (FPC)  (Read 897 times)

jwharton

  • New member
  • *
  • Posts: 9
[Answered] Inline not working in trunk (FPC)
« on: June 13, 2020, 06:01:17 am »
I am working from sources directly on Windows and I am having a problem with the startlazarus.exe program.  When I go to start up it gives me the error that it can't find "D:\freepascal\lazarus\trunk\lazarus".  I noticed the lack of the ".exe" file extension.  I found the source for this and looked into it and there is a function in the fileutil.inc file that is as follows:

interface
...
function GetExeExt: string; inline;
...
implementation
...
function GetExeExt: string;
begin
  {$IFDEF WINDOWS}
  Result:='.exe';
  {$ELSE}
  Result:='';
  {$ENDIF}
end;


I noticed when I compile it that it is picking up the code from the WINDOWS block of code in the compiler directive block.  If I make a syntax error in that code it fails to compile.  So, I know it isn't a compiler directive issue.  However, when I trace this program executing here (line 319 of LazarusManager.pas):

      DefaultExe:=DefaultDir+'lazarus'+GetExeExt;

There isn't any extension added to the value given to DefaultExe.

This tells me that for some reason the code that was supposed to be inlined into this didn't make it.  I proved this out by commenting out the inline directive on the GetExeExt() function and then it worked as expected.

I can hardcode things for now and make it work, but I thought I should report this somewhere.  This could be causing problems elsewhere too. 

I apologize if there is a better place to make this kind of report.  I neglected to take the time to figure out if so. 

Jason Wharton
www.ibobjects.com
« Last Edit: June 13, 2020, 06:31:41 am by jwharton »

Awkward

  • Full Member
  • ***
  • Posts: 135
Re: Inline not working in trunk (FPC)
« Reply #1 on: June 13, 2020, 06:11:08 am »
https://bugs.freepascal.org/view.php?id=37034
As you can see, problem is known, described but still didn't fixed.

jwharton

  • New member
  • *
  • Posts: 9
Re: Inline not working in trunk (FPC)
« Reply #2 on: June 13, 2020, 06:31:16 am »
Thank you for directing me where I should have gone to start with.
I added a note with my findings, even though it appears they are well on top of things.

 

TinyPortal © 2005-2018