lint-like tool for C++
Hi,
Does anyobody know of a free lint-like tool for C++ ? I''d prefer if it were for linux but I can survive with a Windows or even a Macintosh version.
For those of you who do not know lint, it is a tool which checks source codes for ansi compliance, for a big range of common mistakes (error 777 : == used to compare floats) and for some style aberrations.
Thanks,
David
P.S. :
Firahs, this was not an attack against Macintosh.
Sorry, I don''t know about a lint-like tool, but I was wondering about the "error 777 : == used to compare floats". If you can''t use == to compare floats, how do you compare floats?
/. Muzzafarath
/. Muzzafarath
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
You don''t compare floats at all : with numerical deviation, (a+1)-1 == a returns false.
What you can check is if two floats are close. In order to do this, you define an epsilon and you check if [a-epsilon, a+epsilon] and [b-epsilon, b+epsilon] intersect.
Be reading you,
David
What you can check is if two floats are close. In order to do this, you define an epsilon and you check if [a-epsilon, a+epsilon] and [b-epsilon, b+epsilon] intersect.
Be reading you,
David
Last I checked (but this was years ago), C++ was considered to be such a horribly structured language that any prototype version of lint++ died in a horrible painful death.
Consider for example this template example:
list <list<int >> l;
This is clearly a list of list of ints. However any parser with the same rigour of lint would barf when it saw >>.
Edited by - SiCrane on May 19, 2000 1:22:37 PM
Consider for example this template example:
list <list<int >> l;
This is clearly a list of list of ints. However any parser with the same rigour of lint would barf when it saw >>.
Edited by - SiCrane on May 19, 2000 1:22:37 PM
LCLint is a free lint for Windows and Linux. You can find it at http://lclint.cs.virginia.edu/
quote: Original post by SiCrane
Consider for example this template example:
list <list<int >> l;
This is clearly a list of list of ints. However any parser with the same rigour of lint would barf when it saw >>.
I thought, to be honest, that this would throw up a compilation error anyway, the idea being that you need a space to separate it? Perhaps compilers are intelligent enough to work around this but I would have thought the language demanded whitespace?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement