Original Post
🔒 Locked
Additional code testing...
Advertisement
I mainly use Lint and Rational Purify as testing tools and find both to be great.
Lint is good for finding things like variables you aren't using and just general code style problems. You can trust what it bungs out, but be warned... most of it wont make your code faster, or necessarily find bugs
i.e.
At a certain level, it may tell you
if (blah==blam) dosomething();
is bad coding style and you should use
if (blah==blam)
{
dosomething();
}
oh.. and lint also does stuff like telling you when variables aren't initialised... which is REALLY useful (possibly its best feature as far as i'm concerned)
Rational Purify finds things like memory leaks ... and is excellent for this (although, you can use crtdbg under Windows to do a similar task)
Stu M
[edited by - Stuart Miller on October 6, 2002 9:14:31 AM]
Lint is good for finding things like variables you aren't using and just general code style problems. You can trust what it bungs out, but be warned... most of it wont make your code faster, or necessarily find bugs
i.e.
At a certain level, it may tell you
if (blah==blam) dosomething();
is bad coding style and you should use
if (blah==blam)
{
dosomething();
}
oh.. and lint also does stuff like telling you when variables aren't initialised... which is REALLY useful (possibly its best feature as far as i'm concerned)
Rational Purify finds things like memory leaks ... and is excellent for this (although, you can use crtdbg under Windows to do a similar task)
Stu M
[edited by - Stuart Miller on October 6, 2002 9:14:31 AM]
Pretty much so, yes.
But its very unlikely that you''ll want to put your code through plain vanilla lint, as the rule set in lint may contradict what you deem to be correct coding style.
lint is exactly what the name implies. It looks for "bits of fluff" in your code that may cause issues in the long term.
In general, you''ll want to modify your lint config and remove many of the warning sets, because they wont be applicable or wont really matter that much.
I''ve got lots of things turned off when I run lint, because its either against my coding guidelines or I feel it''s unimportant.
Vanilla lint doesn''t have anything turned off, so you''re probably getting lots of superficial errors.
I recommend that you look through the documentation on customising the lint config. You''ll find lots of classes of error that are really unimportant.
Also, look through the warning list that you''ve got, and see what warnings you''ve had generated. Then, using that list, decide which ones you believe are important / unimportant and create your own rules set (by turning off/turning on the various warning sets)
Stu M
But its very unlikely that you''ll want to put your code through plain vanilla lint, as the rule set in lint may contradict what you deem to be correct coding style.
lint is exactly what the name implies. It looks for "bits of fluff" in your code that may cause issues in the long term.
In general, you''ll want to modify your lint config and remove many of the warning sets, because they wont be applicable or wont really matter that much.
I''ve got lots of things turned off when I run lint, because its either against my coding guidelines or I feel it''s unimportant.
Vanilla lint doesn''t have anything turned off, so you''re probably getting lots of superficial errors.
I recommend that you look through the documentation on customising the lint config. You''ll find lots of classes of error that are really unimportant.
Also, look through the warning list that you''ve got, and see what warnings you''ve had generated. Then, using that list, decide which ones you believe are important / unimportant and create your own rules set (by turning off/turning on the various warning sets)
Stu M
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement