bug-cflow
[Top][All Lists]
Advanced

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

[bug-cflow] cflow: macro detection


From: Ramiro Magno
Subject: [bug-cflow] cflow: macro detection
Date: Sat, 9 Jun 2012 04:02:38 +0100

=> given this code:
------------------------------------------------------
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define ONE 1

void fn(int a, int b);

int main()
{
fn(3,4);
return 0;
}

void fn(int a, int b) {
    int max=2;
    a = max+max(a,b);
    b = min(a,b)+ONE;
}
---------------------------------------------------------


=> 'cflow -i x' will return this:
----------------------------------------------------------
main() <int main () at test.c:7>:
    fn() <void fn (int a,int b) at test.c:13>:
        min()
        ONE
----------------------------------------------------------

=> detecting the macro min() but not the macro max() because it is shadowed by 
the local var max I believe.
Is this a bug or a feature? Can this be circumvented?

R.



reply via email to

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