This patch is based on D10305 in order to make it work the existing infrastructure.
By applying this patch, two different bug reports can be compared with existing CmpRuns.py.
Currently, "issue_hash" in plist file is just "line offset from the beginning of function".
But it even cannot distinguish those kind of simple cases that are completely different bugs.
BUG 1. garbage return value
1 int main() 2 { 3 int a; 4 return a; 5 } test.c:4:3: warning: Undefined or garbage value returned to caller return a; ^~~~~~~~
BUG 2. garbage assignment
1 int main() 2 { 3 int a; 4 int b = a; 5 return b; 6 } test.c:4:3: warning: Assigned value is garbage or undefined int b = a; ^~~~~ ~
Moreover, The following bug is regarded as different from BUG 1.
BUG 3. a single line of comment is added based on BUG 1 code.
1 int main() 2 { 3 // main function 4 int a; 5 return a; 6 } test.c:5:3: warning: Undefined or garbage value returned to caller return a; ^~~~~~~~
The comparison result is as follows:
REMOVED: 'test.c:4:3, Logic error: Undefined or garbage value returned to caller' ADDED: 'test.c:5:3, Logic error: Undefined or garbage value returned to caller' TOTAL REPORTS: 1 TOTAL DIFFERENCES: 2
This patch generates the "issue_hash" with the following information:
- column number
- source line string after removing whitespace
- bug type (bug message)
This patch cannot be the final solution, but it enhances "issue_hash" to distinguish such kind of cases by generating stronger hash value.