PC-Lint: undeclared funtion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • suppamax

    PC-Lint: undeclared funtion

    Hi everybody!

    I'm using for the first time PC-Lint.

    I'm analysing my C program for Microchip PIC18F
    microcontroller .

    In particualr I have a problem with library
    functions like "memcpy" or "ltoa".

    I've included <string.hand <stdlib.hin my
    files, and I've added their path in my lin.bat file.

    But it seems that PC-lint is unable to recognise
    them, since I receive the following message

    (void)memcpy((v oid *)&FailureBuffe r.date,
    (const void *)&g_CurrentTim e, sizeof(timestam p_t));
    ...\source files\app_check .c 292 Info 718: Symbol
    'memcpy' undeclared, assumed
    to return int
    ...\source files\app_check .c 292 Info 746: call
    to function 'memcpy()' not
    made in the presence of a prototype

    and

    Warning 526: Symbol 'memcpy()' (line 292, file
    ...\source files\app_check .c) not
    defined
    ...\source files\app_check .c 292 Info 830:
    Location cited in prior message
    Warning 628: no argument information provided for
    function 'memcpy()' (line
    292, file ..\source files\app_check .c)
    ...\source files\app_check .c 292 Info 830:
    Location cited in prior message


    What can I do?


    Thanks,


    Max
  • Mike Wahler

    #2
    Re: [OT, link] PC-Lint: undeclared funtion

    "suppamax" <max.giacometti @gmail.comwrote in message
    news:ff44ae0d-a9a4-4262-b7f1-fd6d21db0005@f6 3g2000hsf.googl egroups.com...
    Hi everybody!
    >
    I'm using for the first time PC-Lint.
    >
    I'm analysing my C program for Microchip PIC18F
    microcontroller .
    >
    In particualr I have a problem with library
    functions like "memcpy" or "ltoa".
    The topic here is only the C language, not specific
    tools. However, see:

    PC-lint Plus is a static analysis tool that finds defects in software by analyzing the C and C++ source code.


    -Mike


    Comment

    • user923005

      #3
      Re: PC-Lint: undeclared funtion

      On Jun 19, 7:02 am, suppamax <max.giacome... @gmail.comwrote :
      Hi everybody!
      >
      I'm using for the first time PC-Lint.
      >
      I'm analysing my C program for Microchip PIC18F
      microcontroller .
      >
      In particualr I have a problem with library
      functions like "memcpy" or "ltoa".
      >
      I've included <string.hand <stdlib.hin my
      files, and I've added their path in my lin.bat file.
      >
      But it seems that PC-lint is unable to recognise
      them, since I receive the following message
      >
          (void)memcpy((v oid *)&FailureBuffe r.date,
      (const void *)&g_CurrentTim e, sizeof(timestam p_t));
      ..\source files\app_check .c  292  Info 718: Symbol
      'memcpy' undeclared, assumed
          to return int
      ..\source files\app_check .c  292  Info 746: call
      to function 'memcpy()' not
          made in the presence of a prototype
      >
      and
      >
      Warning 526: Symbol 'memcpy()' (line 292, file
      ..\source files\app_check .c) not
          defined
      ..\source files\app_check .c  292  Info 830:
      Location cited in prior message
      Warning 628: no argument information provided for
      function 'memcpy()' (line
          292, file ..\source files\app_check .c)
      ..\source files\app_check .c  292  Info 830:
      Location cited in prior message
      >
      What can I do?
      <ot>
      Define the path variable so that pc-lint can find the headers.
      </ot>

      It's in the documentation.

      Comment

      • Barry Schwarz

        #4
        Re: PC-Lint: undeclared funtion

        On Thu, 19 Jun 2008 07:02:00 -0700 (PDT), suppamax
        <max.giacometti @gmail.comwrote :
        >Hi everybody!
        >
        >I'm using for the first time PC-Lint.
        >
        >I'm analysing my C program for Microchip PIC18F
        >microcontrolle r.
        >
        >In particualr I have a problem with library
        >functions like "memcpy" or "ltoa".
        >
        >I've included <string.hand <stdlib.hin my
        >files, and I've added their path in my lin.bat file.
        >
        >But it seems that PC-lint is unable to recognise
        >them, since I receive the following message
        >
        (void)memcpy((v oid *)&FailureBuffe r.date,
        >(const void *)&g_CurrentTim e, sizeof(timestam p_t));
        Others have addressed the lint problem. But why, if you have a
        prototype in scope, are you casting the arguments to memcpy? It
        cannot help and my even camouflage undefined behavior.


        Remove del for email

        Comment

        • Chris H

          #5
          Re: PC-Lint: undeclared funtion

          In message
          <ff44ae0d-a9a4-4262-b7f1-fd6d21db0005@f6 3g2000hsf.googl egroups.com>,
          suppamax <max.giacometti @gmail.comwrite s
          >Hi everybody!
          >
          >I'm using for the first time PC-Lint.
          >
          >I'm analysing my C program for Microchip PIC18F
          >microcontrolle r.
          >
          >In particualr I have a problem with library
          >functions like "memcpy" or "ltoa".
          >
          >What can I do?
          Contact Gimpel support?
          Ask on the forum on the Gimpel web site?

          \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
          \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
          \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



          Comment

          Working...