+1
Planned

[W510] False positive with string concatenation

Uwe Schuster 10 years ago updated by dummzeuch 9 years ago 9
String concatenation leads to false positive W510

StringParamProc('A' + 'A'); //[FixInsight Warning] <unit>(<line>): W510 Values on both sides of the operator are equal

In the real life code the param is a delimiter, which is "sLineBreak + sLineBreak"
Under review
I can add an exception for sLineBreak identifier, but I think your example is not a false positive. I think 'A' + 'A' looks weird and it is something that definetely worth looking at.
My simplification was a bit bad and a sLineBreak exception is sufficient for the moment.
Could you also add an exception for Random?
I have this kind of code here and there:

IntToStr(Random(MaxDiv2) - Random(MaxDiv2));
FloatToStr((Random - Random) * Random(MaxDiv2));

Yes, it looks a bit stupid, but it's used in automated tests to give unexpected values.
No problem. Actually, I'm going to make it possible for you to create your own exception list in settings.

But you already can do so by adding //FI:W510 to the line

http://sourceoddity.com/fixinsight/doc.html#suppress

if StartsStr(PathDelim + PathDelim, Full) then


gives the same warning and is definitely no error.

I got the same warning for no error

Could you please also add an exception for

PathDelim + PathDelim ?

(Or am I the only one who works with UNC paths?)