generate C flowgraph
cflow [-r] [-ix] [-i_] [-dnum] files
command analyzes a collection of C,
assembler, and object files
and builds a graph charting the external function references.
Files suffixed with
are processed by
and the C compiler as appropriate.
The results of the preprocessed files,
and files suffixed with
are then run through the first pass of
Files suffixed with
Assembled files, and files suffixed with
have information extracted from their symbol tables.
The results are
collected and turned into a graph of external references
that is written on the standard output.
processes supplementary code
set characters in literals and constants
according to the locale specified in the LC_CTYPE
environment variable (see LANG in
Each line of output begins with a reference
number, followed by a suitable number of tabs
indicating the level,
then the name of the global symbol
followed by a colon
and its definition.
Normally only function names that do not begin with
an underscore are listed (see the
For information extracted from C source,
the definition consists of a function's return type
the name of the source file
and the line number
where the definition was found,
delimited by angle brackets.
Definitions extracted from object files
indicate the filename and location
counter under which the symbol appeared
If the compilation system adds a leading underscore to external names,
it is removed.
Once a definition of a name has been printed,
subsequent references to that name contain
only the reference number of the line
where the definition may be found.
For undefined references, only
In addition to the -D, -I, and -U
options (which are interpreted just as they are by
the following options are interpreted by
Reverse the ``caller:callee'' relationship producing an inverted listing
showing the callers of each function.
The listing is also sorted in
lexicographical order by callee.
Include external and static data symbols.
The default is to include
only functions in the flowgraph.
Include names that begin with an underscore.
The default is to exclude
these functions (and data if -ix is used).
decimal integer indicates the depth at which the flowgraph
is cut off.
By default this number is very large.
Attempts to set
the cutoff depth to a non-positive integer will be ignored.
Upon successful completion,
the exit status of cflow is 0,
otherwise the exit status is non-zero.
complains about multiple definitions and only
accepts the first one.
Other messages may come from the various programs used
(for example, the C preprocessor).
Do not feed cflow with the output
files produced by
Input the lex and yacc source files directly to
Otherwise, you may get incorrect results because
may reorder the
line number declarations in their output files.
As an example, suppose the following code is in
i = h();
cflow -ix file.c
produces the output
1 main: int(), <file.c 4>
2 f: int(), <file.c 11>
3 h: <>
4 i: int, <file.c 1>
5 g: <>
When the nesting level becomes too deep, the output of
can be piped to the
using the -e
option of pr, to compress the tab expansion to something
less than eight spaces.
is conformant with:
X/Open Portability Guide, Issue 3, 1989
© 2003 Commands for Programming (CP)
SCO OpenServer Release 5.0.7 -- 11 February 2003