Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-08

strange (?) "result not initialized"

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

In the code below / with fpc 3.2

function TDwarfInformationEntry.ReadName(out AName: PChar): Boolean;
var
   AttrData: TDwarfAttribData;
begin
   PrepareAbbrev;
   if dafHasName in FAbbrev^.flags then begin
     Result := GetAttribData(DW_AT_name, AttrData);
     assert(Result and (AttrData.InformationEntry = Self),
'TDwarfInformationEntry.ReadName');
     Result := ReadValue(AttrData, AName);
   end
   else
   if (dafHasAbstractOrigin in FAbbrev^.flags) and PrepareAbstractOrigin
then
     Result := FAbstractOrigin.ReadName(AName)    //
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   else
     Result := False;
end;

components\fpdebug\fpdbgdwarfdataclasses.pas
line 2875

The indicate line says "fpdbgdwarfdataclasses.pas(2870,30) Warning: Function result variable does not seem to be initialized" And I get the warning 5 times.

I also get one (just one) such warning on:
- the "begin" line of the function
- the "PrepareAbbrev" line (which is a call to a procedure)

This appears to be, due to the function being marked "inline". If I remove the "inline" then the warning goes.

---
Unrelated:

I also get the obvious
fpdbgdwarfdataclasses.pas(2887,30) Note: Call to subroutine "function TDwarfInformationEntry.ReadName(out AName:PChar):Boolean;" marked as inline is not inlined

Of course a call to the function itself is not inlined..... (Well yes, it could be a few times, like loop unroll / but does that warrant a warning?)

Reply by email

Martin
to Martin

Another strange "not inline warning"

All marked as inline
Implementation code of Some is first, then Bar, then FOo. So all code is known,when needed.

Foo => Bar => Some

Bar compiles without warning. So I guess Some was inlined Foo gives a warning. But it warns that "Some is not inlined"

Does that mean, that Bar got inlined in Foo, but that it was not the Bar that inlined Some, but a Bar that did not?

No problem, if the compiler would decide to inline / not inline in whatever way.
But maybe if the message is referring to such nested warnings, then it should indicate that?

real code is
function TDwarfInformationEntry.IsAddressInStartScope(AnAddress:
TDbgPtr): Boolean;

at svn rev 63798
there may be changes in later rev.

Reply by email