Thread: Help on understanding the warning message

  1. #1
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732

    Help on understanding the warning message

    Hi,

    I been getting this warning message, which i couldn;t able to understand. The code was working fine. But when i added a single statment in the same file. It started giving me this warning message, which dosn;t compile to produce a object file

    This is the main file, when i compile this i get the following warning message.

    Code:
    #include "include/stdint.h"
    #include "include/pxa255.h"
    #include "include/viperlite.h"
    #include "led.h"
    
    int main()
    {
        int temp = 10;
    
        ledInit();
       
        // After adding this line i started getting the following warning,
        LedOff(LED_GREEN | LED_RED | LED_YELLOW);
        
        while(1)
        {
            temp = 12;
            ledToggleYellow();
            delay_ms(50);
            ledToggleGreen();
        }
        
        return 0;
    }
    And warning message
    Code:
    blink.c: In function `main':
    blink.c:12: warning: implicit declaration of function `LedOff'
    blink.c:17: warning: implicit declaration of function `ledToggleYellow'
    blink.c:19: warning: implicit declaration of function `ledToggleGreen'
    What does this message means, and when do we get these.

    Thank you

    ssharish2005

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    The compiler is warning you that it found no explicit function declaration for these, and has made an implicit declaration for each of these functions.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Note that implicit declaration is made as this:

    int LedOff(...);

    As I suppose this prototype is different from the actual one - you should include the header file containing the correct prototypes
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Thank you, both of you. That solved me the problem. I never declared the prototype of the function on my header file.

    Thank you once again.

    ssharish2005

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File Server Help
    By lautarox in forum C Programming
    Replies: 146
    Last Post: 09-24-2008, 06:32 PM
  2. Desperate Over Ecs!
    By cookie in forum C Programming
    Replies: 17
    Last Post: 07-16-2008, 01:25 PM
  3. Using malloc
    By ulillillia in forum C Programming
    Replies: 34
    Last Post: 02-20-2008, 06:41 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. warning message
    By potbelle in forum C Programming
    Replies: 11
    Last Post: 04-03-2002, 10:20 PM