Closed ArvinChengcheng closed 1 week ago
when I try to duplicate the function name, it passed. strange!
could you run it without using macros?
It can work when I delete the macro but the last function(initial_diag_evaluate) also have the macro FUNC(...)
i guess the macro has confused the parser so it behaves weirdly.
btw, there is an option to tell cxx2flow to expand macros before parsing it. can you try it?
How to tell cxx2flow? could you please raise a example?
Convert your C/C++ code to control flow chart
Usage: cxx2flow [OPTIONS] [INPUT] [FUNCTION]
Arguments:
[INPUT] Sets the path of the input file. e.g. test.cpp
If not specified, cxx2flow will read from stdin.
[FUNCTION] The function you want to convert. e.g. main [default: main]
Options:
-o, --output <OUTPUT> Sets the output file.
If not specified, result will be directed to stdout.
e.g. graph.dot
-c, --curly Sets the style of the flow chart.
If specified, output flow chart will have curly connection line.
--cpp Use C preprocessor.
-t, --tikz Use tikz backend.
-d, --dump-ast Dump AST(For debug purpose only).
-h, --help Print help information
-V, --version Print version information
Note that you need to manually compile the dot file using graphviz to get SVG or PNG files.
EXAMPLES:
cat main.cpp | cxx2flow | dot -Tsvg -o test.svg
cxx2flow test.cpp | dot -Tpng -o test.png
cxx2flow main.cpp my_custom_func | dot -Tsvg -o test.svg
In short, adding --cpp
should work. It would call cpp
to preprocess the code
when I run "cxx2flow.exe --cpp D:\SDD_autogenerate\temp\TrailerLights_SwC.c TrailerLights" it told me "Error: ←[31mx←[0m program not found" which program it need?
You need cpp
, which is c pre processor.
In any means, I can confirm this is not a cxx2flow's bug. For your problem, you may either remove the macro when generating flowcharts, or add macro definition so cxx2flow can read it. I will close this issue.
this is what I using this is the C file and please double click the bat file, it can repeat the error: temp.zip