简体   繁体   English

如何下载和安装lint?

[英]How do I download and install lint?

Does anyone know how to obtain lint for Mac, Windows, and Linux? 有谁知道如何获得Mac,Windows和Linux的lint? sudo port install lint can't find it. sudo port install lint找不到它。

I've only seen lint for BSD. 我只看过BSD的lint。 There's splint , however, a GPL lint rewrite, and it's available on most Linux distributions. 然而,有一个夹板 ,一个GPL lint重写,它可以在大多数Linux发行版上使用。

From the splint FAQ: 来自夹板FAQ:

Splint supports most, but not all, of the C99 extensions to the ANSI C. Splint支持ANSI C的大多数(但不是全部)C99扩展。

This implies that splint is alas not the same as lint. 这意味着夹板与lint不同。 I've had personal experience with running splint on pieces of code like this: 我已经有过在这些代码片段上运行splint的个人经验:

for (int i; i < 100; i++)
    /* Run code */

As declaration of a variable inside the for loop header is not permitted until C99, like in this example, splint will complain about this. 因为在C99之前不允许在for循环标头内声明变量,就像在这个例子中一样,splint会抱怨这个。 Hence, I'm still looking for a good alternative to splint for Ubuntu. 因此,我仍在为Ubuntu寻找一个很好的替代夹板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM