Prerequisites
Suggested rule title
Pointers parameters should have the right size
Rule description
Check that pointer parameters have the right size according to the compiler architecture.
Rationale
In a migration process from Win32 to Win64, I encountered this error :
n := tmpp.Count;
p := nil;
DynArraySetLength(p, field_type, 1, @n);
The code was build for Win32, so n was an Integer
Now DynArraySetLength takes a PNativeInt which is 64bits wide under Win64 and the Delphi compiler does not emit a single warning about this critical issue.
Would be awesome if Sonarqube could help finding those problems.
Prerequisites
Suggested rule title
Pointers parameters should have the right size
Rule description
Check that pointer parameters have the right size according to the compiler architecture.
Rationale
In a migration process from Win32 to Win64, I encountered this error :
The code was build for Win32, so
nwas anIntegerNow
DynArraySetLengthtakes aPNativeIntwhich is 64bits wide under Win64 and the Delphi compiler does not emit a single warning about this critical issue.Would be awesome if Sonarqube could help finding those problems.