|
|
 |
Gimpel Software - Discussion Forum
We invite you to use this forum to communicate with other PC-lint and
FlexeLint users. You do not need to log in to post a message.
WARNING: Your email address will not be encrypted. We recommend that you
obfuscate it as protection from web crawlers.
To receive technical support directly from Gimpel Software, please follow
the guidelines at http://www.gimpel.com/html/support.htm
Gimpel Software - Discussion Forum
| |
| Subject: |
Warn on functions/macros |
| Date: |
January 26, 2007
3:01:12 AM
|
| Name: |
Per Nilsson |
| Email: |
per.u.nilsson@tac.com |
| Message: |
Hi,
I wonder if (and how) it is possible to prevent
certain function/macros from being used.
For example we would like to produce a lint
error/warning when the assert(...) macro is used
since we, for various reasons, will use another
assertion/contract mechanism.
I've tried playing with +emacro and +esym but I
dont get anything to happen ;-)
Also, is there a way to produce user defined
messages / codes since even if we do manage to
trap the situation mentioned above I can't
really fins a proper lint messgae code to /re)
use for it.
Thanks
|
| |
| Subject: |
Re: Warn on functions/macros |
| Date: |
January 27, 2007
3:07:21 AM
|
| Name: |
Johan Bezem |
| Email: |
j.bezem@computer.org |
| Message: |
You could define the assert-macro in Lint not to
be overwritten by any define in the code using the
'+d<name>=<value>' option (note the '+' sign!). If
you then use something illegal, you'll get a
message ;-)
You can use the option '+headerwarn(assert.h)' to
have Lint warn you about the use of the header
defining your unwanted macro.
And while you cannot define completely new
messages, you can append you own strings to
existing messages using '-append'.
HTH,
Johan Bezem
www.bezem.de
|
| |
| Subject: |
Re: Warn on functions/macros |
| Date: |
January 29, 2007
5:11:07 AM
|
| Name: |
Per Nilsson |
| Email: |
per.u.nilsson@tac.com |
| Message: |
+headerwarn solved the problem.
Thanks!
|
| |
| Subject: |
Re: Warn on functions/macros |
| Date: |
January 31, 2007
7:48:28 AM
|
| Name: |
Mike Diack |
| Email: |
mike_diack@hotmail.com |
| Message: |
There's another way also, in lint 8r and later.
You need to activate lint warning 586 in your lint
options, but you can then use the following lint
directives to handle "dangerous/deprecated" code:
The directive works for functions and macros and
variables (I think).
It takes the form:
-deprecate (object type, object name, user message)
e.g.
//lint -deprecate( function, unlink, This is now
deprecated in favour of _unlink in VC 2005 )
will cause a message of:
"This is now deprecated in favour of _unlink in VC
2005" whenever lint finds me using the unlink
function call.
Likewise:
An example of a macro check:
//lint -deprecate( macro, USES_CONVERSION, Be
careful string conversions are occuring here! )
will cause a message of:
"Be careful string conversions are occuring here!"
whenever lint finds me using the USES_CONVERSION
macro.
|
| |
| Subject: |
Re: Warn on functions/macros |
| Date: |
February 15, 2007
2:52:56 AM
|
| Name: |
Jan de Ruiter |
| Message: |
Question to Gimpel:
Why is there no mention of this new -deprecate in
the read80.txt?
I also noticed it used in au-misra2.lnt
Does this avoid the assert/exit problems with
misra as discussed in
http://www.gimpel.com/Discussion.cfm?ThreadID=2184
?
|
| |
| Subject: |
Re: Warn on functions/macros |
| Date: |
February 20, 2007
8:28:22 AM
|
| Name: |
Mike Diack |
| Email: |
mike_diack@hotmail.com |
| Message: |
Jan - drop me an email on this and I'll explain
why it's not documented.
Mike
|
|