pleriche / FastMM5

FastMM is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files.
283 stars 73 forks source link

Warnings when compiling with 32 bit compiler #9

Open vladimir-cheverdyuk-altium opened 4 years ago

vladimir-cheverdyuk-altium commented 4 years ago

When compiling FastMM5 with 32 bit compiler (Delphi 10.0 Seattle) we got following warnings: E1035: Return value of function 'FastMM_FreeMem_FreeLargeBlock_ReleaseVM' might be undefined E1036 Variable 'LChildDirection' might not have been initialized (в procedure FastMM_PerformMemoryLeakCheck_AddBlockToLeakSummary(APLeakSummary: PMemoryLeakSummary;) and because our projects treats warnings as errors we actually got errors. Is it possible to fix it?

pleriche commented 4 years ago

Hi Vladimir,

I've added a couple of ifdefs in order to suppress the spurious warnings under Delphi 10 Seattle. Please confirm that it resolves the issue for you.

Thanks, Pierre

vladimir-cheverdyuk-altium commented 4 years ago

Hi

Function FastMM_FreeMem_FreeLargeBlock_ReleaseVM. Right now there are following code: {$if CompilerVersion < 31} Result := nil; //Workaround for spurious warning with older compilers {$endif} But function returns Integer, so I think it should be zero

pleriche commented 4 years ago

Hi Vladimir, apologies, that should now be fixed.

obones commented 3 years ago

Hello,

There is a weird issue with Seattle 32bits and the LChildDirection assignment. With your current IFDEF, I get H2077, set value never used. If I remove the code, I get W1036, variable not initialized.

So clearly, the compiler is getting confused in both cases. The only way that I found to keep it quiet is to move the IFDEF and assignment block right before the beginning of the while True loop. Doing this removes the W1036 warning without giving a H2077 hint.

pleriche commented 3 years ago

Thank you, Olivier. I have made the change in the repository.