[SOLVED] PC-lint - error 305: unable to open module

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] PC-lint - error 305: unable to open module

    I have just installed a trial of PC-lint Plus, 1.3.5, to test out with SES.
    I've managed to get it to call lint, by setting up LINTDIR however now when I attempt to lint a file I get the following message:

    Source Code

    1. Linting
    2. Linting main.c
    3. <command line> 14 error 305: unable to open module '"-D'
    4. "-D
    5. ^
    6. PC-lint Plus 1.3.5 for Windows, Copyright Gimpel Software LLC 1985-2020 [debug]
    I'm having trouble getting more detailed output to dig any further. Is it possible to get more details logs/see exactly how it is being called?
  • Hi,
    Thank you for your inquiry.
    It seems like something with the command line went wrong.

    You can find an external tools example for Lint here:
    studio.segger.com/ide_external_tools_file_format.htm

    Does this answer your question?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Hi Fabian,

    Thanks for your reply.
    I did look into the configuration file and noticed it is calling lint with -D__GNUC__, I took this out incase it was the source of the problem but I get the same error message.
    The trouble is I don't know what the call:
    &quot;$(LINTDIR)/lint-nt&quot; -i$(LINTDIR)/lnt &quot;$(LINTDIR)/lnt/co-gcc.lnt&quot; $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros -w2 -e537 +fie +ffn -width(0,4) -hF1&quot;-format=%f:%l:%C:s%t:s%m&quot; &quot;$(InputPath)&quot;
    turns out like once all the options have been substituted.
    I suspect one of the $(DEFINES) is being substituted with something that isn't quite right but without seeing the actual call it is guess work. It looks like it is trying to include a DEFINE that is blank as it looks like a trailing -D.
    Are there any windows/logs/options that will show the actual call to lint rather than just the output?
  • Hi,
    yes there is:
    In the "Output" window, select Tasks instead of "Output" and activate "Echo Build Command Lines" (drop down, top right).

    Do you have any further questions?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Thanks Fabian. I now have the output, unfortunatley I'm still having trouble. I believe the -D issue is because of one of my defines so I ran up the untouched blinky example.
    There are a couple of warnings:

    Source Code

    1. <command line> 47 warning 654: option '+macros' is obsolete; there is no
    2. longer a macro size limit
    3. +macros
    4. ^
    5. <command line> 48 warning 654: option '+macros' is obsolete; there is no
    6. longer a macro size limit
    7. +macros
    8. ^



    I can manually remove the macros option from the tools xml, but this should be udpated for the next release of SES.

    The main issue is the error:

    Source Code

    1. <command line>:56:1: error: unable to open module '[-e%n];'
    Can you run up the blinky example and check whether it works for you?
  • Forgot to specify above, I'm using the nRF52840 and the Nordic SDK - blinky example being the one available within the SDK, specifically examples\peripheral\blinky\pca10056\blank\ses\blinky_pca10056.emProject but I am facing the same problem with any of the example projects.
  • Hi,

    Not sure what went wrong here, but the default Tools.xml has worked for years now and is still working if you set the global macro as explained in the ES documentation.
    For reference here is the xml file source, should it have changed in your config somehow:

    XML Source Code

    1. <tools>
    2. <!-- PC-lint - http://www.gimpel.com/html/pcl.htm -->
    3. <if host_os="win">
    4. <item name="Tool.PClint">
    5. <menu>&PC-lint (Unit Check)</menu>
    6. <text>PC-lint (Unit Check)</text>
    7. <tip>Run a PC-lint unit checkout on the selected file or folder</tip>
    8. <key>Ctrl+L, Ctrl+P</key>
    9. <match>*.c;*.cpp</match>
    10. <message>Linting</message>
    11. <commands>
    12. &quot;$(LINTDIR)/lint-nt&quot; -v -incvar(__CW_ARM) -i$(LINTDIR)/lnt co-gcc.lnt $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros +macros -w2 -e537 +fie +ffn -width(0,4) -hF1 &quot;-format=%f:%l:%C:\s%t:\s%m [-e%n]&quot; &quot;$(InputPath)&quot;
    13. </commands>
    14. </item>
    15. </if>
    16. </tools>
    Display All

    All you have to do is set the LINTDIR as explained in the many other forum threads:
    [DUPLICATE] how to use PC-LINT in SEGGER

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,
    I had the LINTDIR set correctly but it seems I had lost some of the &quot; from my version of tools.xml - I copied your commands section into my tools.xml, with the additional &quot;'s and now it has sprung to life.
    Thanks for the help, Tom.
  • Hi,

    Ah I see, good to hear that you are up and running again.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.