0

What kind of regex spells I need to put to Eclipse 'Regex error parser' to get PC Lint prints to "problems" view (in Eclipse C/C++ Kepler).

Current lint format is -"format=LINT %t%(: %f:%l %) %n %m" which prints:
LINT Info: Y:\path\to\file.c:91 732 Loss of sign (assignment) (int to unsigned long)

What I need is first identify that is it info, warning or error and then get:
1. File: 'Y:\path\to\file.c'
2: line: '91'
3: description: '732 Loss of sign ...'

I found one example which did not work for me (most likely the format is different) and I've tried to create my own regex command unsuccessfully.
It is also possible to change the PC-Lint format if it helps.

1 Answers1

0

We are using the following format option:

+ffn
-"format=\q%f\q,%l  %t[%n]: \t%m\n"

And our Eclipse regex is:

"(.*\\.*\\.*(h|cpp))",([0-9]*).*((Note|Warning|Error|Info)\[[0-9].*\]): *(.*)

File is $1 Line is $3 and as Description we used Lint $4 $6

Which turns into something like:

Lint Warning[534] Ignoring return value of function...

In the problems overview of Eclipse.

Arsenal
  • 333
  • 3
  • 15
  • Thank you! Previously all lint events were shown as errors ( via gcc error parser if I remember correctly). With this I got separate error/warning and info events. I just splitted that regex to three items based on the text. – user3410632 Jan 26 '15 at 06:09
  • @user3410632: you can accept an answer by clicking the checkmark. This will increase your reputation and Arsenal's reputation. – Thomas Weller Jan 30 '15 at 21:22