bug-cflow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cflow] #ifdef problem


From: Rich Yonts
Subject: [bug-cflow] #ifdef problem
Date: Tue, 13 May 2008 14:41:34 -0400

Sergey,

Thank you for cflow. I find it very helpful.

I ran into a problem where I was missing whole functions although the debug trace showed that they were being parsed. I finally narrowed it down to the way that #ifdef processing is being handled. When I have a code block that is begun by which branch of an #ifdef...#else...#endif, cflow does not properly handle the input. Here is a sample program that will show different behavior based on whether the duplicated if is in the code or commented out:

int main() {
#ifdef WIN32
/* commenting out the next line changes the output */
if (x > 0) { //
#else
if (x != NULL && x > 0) {
#endif
y = 1;
} else {
y = 0;
}
doit();
fake();
}

int doit() {
prinntf("Hello, world.\n");
}

int fake() {
int j = 3;
}

When cflow is run this is its output:

main() <int main () at test.c:1>:
doit()
fake()
prinntf()

which shows that it does not see the doit() and fake() functions properly. But when one of the two block opening statements is commented out, there is the output

main() <int main () at test.c:1>:
doit() <int doit () at test.c:16>:
prinntf()
fake() <int fake () at test.c:20>

which is what is expected.

Thank you for your hard work and consideration of this problem.


sola gratia, sola fide, solo Christo, sola Scriptura, soli Deo gloria,

Rich Yonts
address@hidden


Kurie, swson me


reply via email to

[Prev in Thread] Current Thread [Next in Thread]