2

I'm using PC-Lint to generate an XML file that contains all the warnings generated by a run.

The process works almost flawlessly, with a rather annoying exception. I can't get the message format to print the fully qualified function name where the warning was found. It just prints the stripped down function name. No namespace, no class name.

Here is the format string I use (I've included the relevant format info from the documentation at the end of this post):

-"format=<message> <file>%f</file> <func>%i</func> <line>%l</line> <type>%t</type> <code>%n</code> <desc>%m</desc> </message>"

So, for example, for this:

class Bar {
    void foo(int bar) {
    }
};

The error I get is this (lines broken for easier reading):

<message>
  <file>D:\Code\CPPTest\CPPTest.cpp</file>
  <func>foo</func>
  <line>3</line>
  <type>Info</type>
  <code>715</code>
  <desc>Symbol 'bar' (line 2) not referenced</desc>
</message>

As you can see, the function name is written as foo and not Bar::foo as I would like/expect.

Before anyone ask, for the function escape symbol in the -format string, I've tried both %i and %I; both generated the same bare bone function name.

Does anyone know if there's a magical format escape to get the fully qualified name?


From the PC-Lint -format documentation:

%f = the filename
(note that option +ffn, standing for "Full File Names", can be used to control whether full path names are used).
%l = the line number
%t = the message type (Error, Warning, etc.)
%n = the message number
%m = the message text
%c = the column number
%C = the column number +1
%i = the invoking function
%% = a percent sign
%(...%) = conditionally include the information denoted
by ... if the error occurred within a file.
\n = newline
\t = tab
\s = space
\a = alarm (becomes ASCII 7)
\q = quote ( "" )
\ = backslash ( '\' )

joce
  • 9,624
  • 19
  • 56
  • 74

1 Answers1

0

It might be too late for you :) but there is a flag ffn (use full file names in messages)

You can add it to the main lnt file as

+ffn

https://www.gimpel.com/archive/lint7.htm

Joe
  • 6,758
  • 2
  • 26
  • 47