Closed PhamAn12 closed 3 years ago
If you're referring to slines, then srcSlice doesn't output slines directly.
It outputs 'use' and 'def'. Slines = use U def where U is a union operation. So you just have to combine those together to get slines.
If you did not mean slines, please let me know.
That's exactly what I want to ask. Thank you for your answer. I tried the input program with variable Struct, and the results seem to be inaccurate. That's my input a.c :
#include <stdio.h>
// An example function that takes two parameters 'x' and 'y'
// as input and returns max of two input numbers
struct nguoi {
int ngaysinh;
int thangsing;
};
int max(int x, int y)
{
if (x > y)
return x;
else
return y;
}
// main function that doesn't receive any parameter and
// returns integer.
int main(void)
{
int a = 10, b = 20;
struct nguoi cc;
cc.ngaysinh = 1;
cc.thangsing = 2;
// Calling above function to find max of 'a' and 'b'
int m = max(a, b);
printf("m is %d", m);
return 0;
}
where was i wrong ? Have you covered all the cases yet?
Typically, this happens when you've run srcML without --position turned on.
i.e., srcml --position (input file)
--position turns on line position information in the srcML archive, which srcSlice requires to run correctly.
In the newer srcSlice version we tell you when we see that this has happened, but the old version, unfortunately, does not. Hopefully, the new version will be completed soon.
I used the old version to check my c program for slicing. But I can't see the slices field in the output . Is that an error ?