bug-cflow
[Top][All Lists]
Advanced

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

Re: [bug-cflow] CFlow 1.4 mistakes cast to fixed size array of custom ty


From: Riley Wood
Subject: Re: [bug-cflow] CFlow 1.4 mistakes cast to fixed size array of custom type for a function call.
Date: Tue, 21 Feb 2017 18:25:30 -0500

Never mind, I think I may just need to let the preprocessor run to resolve the includes which contain the typedef

On Tue, Feb 21, 2017 at 6:05 PM, Riley Wood <address@hidden> wrote:
I noticed today that CFlow was claiming that my function called...a type.

Here is the equivalent code snippet

void my_func(const my_type an_array[ARRAY_LEN])
{
    x = (my_type (*)[ARRAY_LEN])an_array;
}

The cflow graph shows "my_func" calling into "my_type", which is of course not right. I believe this may be because it interprets the (*) which appears after my_type as the open/close parens of a function call. I'm curious to know if you can duplicate this on your setup.

The following code will trigger the bug:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

some_type_t (*x)[10];

int main() {
    some_type_t my_ints[10];
    x = (some_type_t (*)[10]) my_ints;
    (void)(x);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cflow output: 
main() <int main () at cflow_bug.c:4>:
    some_type_t()

If the typedef for some_type_t appears in the same file, the problem goes away. So it appears to be an issue when it cannot resolve the type and therefore assumes it's a function? Maybe?

--
Riley Wood
Software Engineer
ClearMotion
475 Wildwood Ave. 
Woburn, MA 01801 
address@hidden
---

Statement of Confidentiality

This email and any files transmitted with it are confidential (whether individually marked or not) and intended solely for the use of the individual or entity to whom they are addressed.




--
Riley Wood
Software Engineer
ClearMotion
475 Wildwood Ave. 
Woburn, MA 01801 
Cell: 914-874-7315
address@hidden
---

Statement of Confidentiality

This email and any files transmitted with it are confidential (whether individually marked or not) and intended solely for the use of the individual or entity to whom they are addressed.


reply via email to

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