0

Using PC-Lint, I'm attempting to make a header file be treated as a library header so that I can suppress messages from inside it. I'm using the library module option +libm(module.c) which should treat module.c as a library module and any headers it includes (i.e module.h) as library headers as described in section 6.1 of the PC-Lint manual for v9.00. Naturally, module.h is also included in my source files which are not library modules.

The problem is that when I lint the code, I still get messages from module.h even though I provided the +libm(module.c) option. I suspect this is because the module.h file is included in my other non-library modules. But such a situation is a typical use case and so this makes this +libm option useless. I know I could use +libh(module.h) or +libdir(...) but I want +libm(module.c) to work properly for me. Any suggestions?

StellarVortex
  • 576
  • 4
  • 19
alphaOri
  • 87
  • 3
  • 6

1 Answers1

0

It is not presented like that in the manual, but my experience shows that not all header files included by the library module are considered library. They cannot be: What if the module includes your own header files, the header files you want explicitly to be processed?

Use the Lint option -vf (caution: large output!) to see how Lint interprets your header files. Library files are designated as such. The ones missing can be added using the normal -lib* option set.

Johan Bezem
  • 2,582
  • 1
  • 20
  • 47
  • "They cannot be: What if the module includes your own header files, the header files you want explicitly to be processed?" It seems to me that the '+libm' option is provided for those who _know_ that a module is a library module. For example, my code runs on a third-party RTOS for which I have the source code. I want to use '+libm' on these modules in order to get inter module value tracking but I do not want to see errors from such modules because I don't maintain them. Thus, I _know_ those modules do not include my header files so I want '+libm' to work like the manual claims it should. – alphaOri Nov 29 '12 at 09:06
  • Did the `-vf` option shed any light? Then write a bug report to support@gimpel.com, and see what they say. BTW, do you have patch 9.0i, the latest one? – Johan Bezem Nov 29 '12 at 09:52