Help on understanding the warning message

This is a discussion on Help on understanding the warning message within the C Programming forums, part of the General Programming Boards category; Hi, I been getting this warning message, which i couldn;t able to understand. The code was working fine. But when ...

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

    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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    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, 07:32 PM
  2. Desperate Over Ecs!
    By cookie in forum C Programming
    Replies: 17
    Last Post: 07-16-2008, 02: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, 07:39 AM
  5. warning message
    By potbelle in forum C Programming
    Replies: 11
    Last Post: 04-03-2002, 10:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21