Thu*_*fir 9 command-line programming c tee coreutils
Ubuntu 有 lint 实用程序吗?它是如何安装的?
在计算机编程中,lint 是一种 Unix 实用程序。
https://en.wikipedia.org/wiki/Lint_%28software%29
thufir@mordor:~$
thufir@mordor:~$ gcc program.c -o prog
program.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
^
thufir@mordor:~$
thufir@mordor:~$ ./prog
Hello World
thufir@mordor:~$
thufir@mordor:~$ lint program.c
No command 'lint' found, did you mean:
Command 'line' from package 'util-linux' (main)
Command 'jlint' from package 'jlint' (universe)
Command 'link' from package 'coreutils' (main)
Command 'dlint' from package 'dlint' (universe)
Command 'lift' from package 'lift' (universe)
Command 'tint' from package 'tint' (universe)
Command 'hlint' from package 'hlint' (universe)
lint: command not found
thufir@mordor:~$
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用 lint:
lint 程序.c | tee 程序.lint
这将在计算机上显示命令 lint program.c 的标准输出,同时将其副本保存在文件 program.lint 中。如果名为 program.lint 的文件已存在,则将其删除并替换。
https://en.wikipedia.org/wiki/Tee_%28command%29#Unix-like_2
维基百科引用的联机帮助页是针对 BSD 的,我找不到 Linux 变体的联机帮助页。也许我需要安装它?
从 apt-cache search lint
夹板 - 用于静态检查 C 程序错误的工具。
splint-data - 静态检查 C 程序错误的工具 - 数据文件
splint-doc-html - 静态检查 C 程序错误的工具 - HTML 文档
sudo apt-get install splint
Run Code Online (Sandbox Code Playgroud)
有关文档、示例和下载,请查看其网站http://www.splint.org。