Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-04-2009
Member
 
Join Date: May 2008
Posts: 923
How to avoid the warnings "implicit declaration"

I'm working on a project in C and I have some time of warnings like this one :

Warning.c: 54: Attention: implicit declaration of function 'isblank'

I do not understand what it means and I do not necessarily correct. The program seems to behave as desired, but I would like this code is clean. Could you inform me?
Reply With Quote
  #2  
Old 10-04-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: How to avoid the warnings "implicit declaration"

Is the function isblank () and its lines of code, are before or after the call to this function? It seems that the code isblank () is after his appeal (in which case it would change up the lines of code), or that is in another file, and it lacks a statement of "prototype" for this function (in which case it would add a prototype).
Reply With Quote
  #3  
Old 10-04-2009
Member
 
Join Date: May 2008
Posts: 685
Re: How to avoid the warnings "implicit declaration"

#include <ctype.h>

it should work better. In C you have to #include the corresponding functions used. If in doubt, better to put too much than not enough.

As against C, in the strict sense of language, any function that returns an integer can be used without declaration, which is why you have a warning and not an error, but it is not recommended.
Reply With Quote
  #4  
Old 10-04-2009
Member
 
Join Date: May 2008
Posts: 945
Re: How to avoid the warnings "implicit declaration"

This means that you call a function without having provided a prototype first. The compiler then assumptions about the type of parameters and the return. It does not check whether the number of parameters is consistent. The behavior is unspecified.

To code correctly, you need to provide a prototype. the role header (.h) contain precisely the prototypes of functions.

Code:
#include <ctype.h>
Reply With Quote
  #5  
Old 10-04-2009
Member
 
Join Date: May 2008
Posts: 685
Re: How to avoid the warnings "implicit declaration"

The compiler performs exactly one and only one assumption: that the return type is integer. The behavior is determined: the return value will be caste bit-by-bit from an integer. The parameters are always passed in any way in C you can pass anything as a parameter.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to avoid the warnings "implicit declaration""
Thread Thread Starter Forum Replies Last Post
How to avoid Windows apps to appear in "Open With" contextual menu MarDaA Windows Software 3 03-02-2012 05:26 PM
How to avoid "Show Cached Process" in Sony Ericsson Xperia Arc S V.Gerard Portable Devices 2 10-01-2012 05:45 PM
Visual Basic 2008 error "Option Strict On disallows implicit conversions" Caiden Software Development 3 30-10-2009 06:27 PM
Difference between Implicit and Explicit Declaration vinodpathak_214 Software Development 3 16-01-2009 10:00 AM
How to avoid "The requested operation requires elevation" OzAndrew Vista Help 6 21-06-2007 12:00 PM


All times are GMT +5.5. The time now is 10:08 PM.