我有一些冗长的 C 和 CPP 代码文件,并且希望在其中获取函数名称。
我下载了cproto-4.7c-bin.zip
到我的 Windows 7 系统并在命令提示符中尝试以下操作:
C:\Users\admin\Desktop\cproto-4.7c-bin\bin>cproto -f fileExec.c
/* stdin */
什么也没发生。它似乎挂起;它显示 /* stdin */
直到我关闭命令提示符窗口(有效地杀死它)。 C:\Users\admin\Desktop\cproto-4.7c-bin\bin
中的 trace.out
文件为空。
最佳答案
/* stdin */
消息表示它正在等待 stdin 上的输入。
起初,我找到了原来的,但现在已经不复存在的项目here 。问题中引用的新版本看起来有不错的文档。如果执行cproto --help
,它会打印出以下用法语句:
cproto: invalid option -- '-' usage: cproto [ option ... ] [ file ... ] Options: -a, -t Convert function definitions to ANSI or traditional style -b Rewrite function definitions in both styles -c Enable comments in prototype parameters -e Output "extern" keyword before global declarations -f n Set function prototype style (0 to 3) -l Generate output in lint-library style -o file Redirect output to file -O file Redirect errors to file -p Disable formal parameter promotion -q Disable include file read failure messages -s Output static declarations also -S Output static declarations only -T Output type definitions -v Output variable declarations -x Output variables and functions declared "extern" -m Put macro around prototype parameters -M name Set name of prototype macro -d Omit prototype macro definition -P template Set prototype format template " int f (a, b)" -F template Set function definition format template " int f (a, b)" -C template Set format for function definition with parameter comments -D name[=value] Define C preprocessor symbol -U name Undefine C preprocessor symbol -I directory Add #include search directory -E command Run specified C preprocessor command -E 0 Do not run any C preprocessor -V Print version information
您需要为 -f
选项提供一个额外的参数(或者干脆将其删除)。例如:
C:\Users\admin\Desktop\cproto-4.7c-bin\bin>cproto -f3 fileExec.c
或
C:\Users\admin\Desktop\cproto-4.7c-bin\bin>cproto fileExec.c
关于c++ - 如何在 Windows 上使用 cproto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37592979/