Enter forum description here ...
0

Empty then block

Anonymous 10 years ago 0

Samples:

if Condition() then ;// See last symbol before comment

begin

SomeCode; //this line executed in all cases

end;

or

if Condition() then

begin

//SomeCode;

end else begin

//SomeOtherCode;

end;

or

if not Condition() then

else

begin

SomeCode;

end;

0
Fixed

[W521] False positive with @Result

Uwe Schuster 10 years ago updated by Roman 10 years ago 3
Using @Result as parameter leads to W521.

SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0);//-> W521
SystemParametersInfo(SPI_GETWORKAREA, 0, Result, 0);//-> no W521
0
Planned

Config dialog should remember its position and size

dummzeuch 10 years ago updated by Roman 10 years ago 1

Currently the config dialog is shown at a given position and with a given size (I'm glad that it is at least resizable). When I move or resize it, it does not remember that the next time its opened.


(If you implement this, please make sure that the dialog is visible when restoring its size/position. Been there, done that...)

0
Under review

Check for potential AV, usage after .Free, .DisposeOf or := nil

Tommi Prami 10 years ago updated by Roman 10 years ago 1

Just thought that this could be possibly quite easy to check (At least the Trivial cases)


Sometimes you tinker the code but just do not see the access to the Class instance after the line. Or sometimes you reorder code for some other reason and does not see. Or we code Monkeys are sometimes just blind and stupid :D


Problem would be to analyze the False positives. But even catching trivial cases would be helpful.


begin

...

LS.Free;

LS.Add('Funk'); // Error/Warning of access Freed object

...

end;


begin

..

LS := nil;

...

if Assigned(LS) or (LS <> nil) then

LS.Add('Rock')

else

LS.Add('This Rocks Also');

...

LS.Add('Funk You!'); // Error/Warning of access Freed object

end;


But Detecting all is very hard because class could be passed as Var parameter etc and returned Freed and possibly nil, but worse case is the it is freed but not set to nil, if used before that particular call.


Have bumbed errors like this sometimes, that there are Object passed around and there is this one magical castle of code that calls .Free;

0
Completed

Disable warnings for a unit without having to add this to the ignore list

dummzeuch 10 years ago updated by Roman 10 years ago 2
Currently, in order to ignore a unit you have to add it to the ignore list. This list is on a per project basis. Assuming a 3rd party unit that I don't want to be processed in any of my projects, I have to add and ignore entry it to all the projects. How about either
* Add a special comment to the unit source code:
unit blablb; //FI:ignore
* Have a configuration file in the directory where the unit resides that allows to change the FixInsight configuration for all files in that directory?
(or both)

(Yes, that's exactly how the GExperts code formatter works.)
Answer
Roman 10 years ago
//FI:ignore

implemented in FixInsight 2015.11

0
Completed

New warning: Getter/Setter names are different from property declaration

Lübbe Onken 10 years ago updated by Roman 10 years ago 5
I suggest another convention "Getter/Setter Name is different from property declaration" ?
The convention would be that the getter/setter name = Get<propertyname>/Set<propertyname>

Example:

TMyObject = class
private
function GetText: string;
public
property Name: string read GetText;
end;
0
Fixed

[W519] False positive when an external function is defined

Lübbe Onken 10 years ago updated by Roman 10 years ago 2
We just turned W519 on, since we now have the option to turn it off selectively. But there are false positives, when functions are pulled in from a dll.

The following line returns "FixInsight Warning] xxx.pas: W519 Method 'StrCmpLogicalW' is empty"
function StrCmpLogicalW; external 'shlwapi.dll' name 'StrCmpLogicalW';
Yes, there is no function body, but where should it come from? :)
0
Started

Provide feedback on the number of messages during processing

dummzeuch 10 years ago updated by Roman 10 years ago 2

Currently there is a progress dialog that shows the file names and the general progress.

It would be nice to also have a counter of messages that have been generated so far. It would allow me to abort the (lengthy) process to check and fix those messages that have been generated.

0

New warning: Declared but not used variables

Nicholas Ring 10 years ago 0

While the complier does a good job of warning the developer if a variable has been declared but not used, it doesn't always catch them all - especially if the variable is an interface.


It would be good if it ignored any nil assignments. Example:

var
  LMyInterface : IMyInterface;
begin
  LMyInterface := nil;
  // ... blah blah blah
end;  

The above would be treated as declared but not used.


Possibility add an optional about the assignment?

0
Fixed

Bug in FixInsight_2015.11upd5 Command Line

Lübbe Onken 9 years ago updated by Roman 9 years ago 4

The following Bug was introduced in upd4 or upd5. upd3 works fine. Today I finally found time to check what happens. Only command line, the IDE integration is not affected.


Consider the following simple program:


program MyProg; uses MyModule; // MyModule in 'MyModule.pas'; begin end.

Running the command line on the above file is ok and produces the following log:


20.01.2016 12:28:49 Command line tool started
20.01.2016 12:28:49 GetProjectFileList
20.01.2016 12:28:49 ReadFileToBuffer: MyProg.dpr
20.01.2016 12:28:49 Size: 88
20.01.2016 12:28:49 Encoding: 1252  (ANSI - Lateinisch I)
20.01.2016 12:28:49 AllocateBuffer[Addr: 2776F30, Size: 178]
20.01.2016 12:28:49 FreeBuffer[Addr: 2776F30]
20.01.2016 12:28:49 MyModule.pas
20.01.2016 12:28:49  
20.01.2016 12:28:49 Run analysis
20.01.2016 12:28:49 Looking at MyModule.pas
20.01.2016 12:28:49   Skipping...
20.01.2016 12:28:49 Parser errors not found
20.01.2016 12:28:49 ExitCode = 0

If you comment out the first "mymodule" line and remove the comment from the second, the command line fails and produces the follwing log:


20.01.2016 12:29:12 Command line tool started
20.01.2016 12:29:12 GetProjectFileList
20.01.2016 12:29:12 ReadFileToBuffer: MyProg.dpr
20.01.2016 12:29:12 Size: 88
20.01.2016 12:29:12 Encoding: 1252 (ANSI - Lateinisch I)
20.01.2016 12:29:12 AllocateBuffer[Addr: 2666F30, Size: 178]
20.01.2016 12:29:12 FreeBuffer[Addr: 2666F30]
20.01.2016 12:29:12 Parser Error: Invalid pointer operation
20.01.2016 12:29:12 Failed to parse MyProg.dpr
20.01.2016 12:29:12 ExitCode = 2

It doesn't matter, if MyModule.pas exists or not. The crash obviously occured on a well hung project of ours, where all files exist.

Answer
Roman 9 years ago

Hi Lübbe, this issue is fixed in upd6 which is available to download from the website. That was an accidental regression after parser refactoring. But good news is that now it works faster :)