![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2005
Posts: 15
Rep Power: 0
![]() |
GCC - Warning: implicit declaration of function
Hi all,
Just a question about a gcc warning I've received on a few different programs when compiling with the -Wall option... warning: implicit declaration of function ‘whateverfunction()’ For example, in one program I use toupper() twice, and it only gives the warning on one line. In the same program, it gives another warning for isdigit(). The appropriate libraries are included, so I'm not sure what the deal is. Is this even something to worry about? I've Googled around and searched on here, but I cannot find an explanation (or at least one that applies to Standard C Library functions). I know that -Wall turns on all the warnings, but I've been told that that's a good way to find errors and bugs, so I just want to make sure I'm not doing anything wrong. BTW... I'm using Ubuntu 6.06, gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5), and Glibc 2.3.6. Thanks. |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
Post your code.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You're missing the include file(s) that declare the functions (their form, or prototype). C will presume that they have an integral argument and return an integer. Should this turn out to be an unwarranted assumption, you'll have trouble at the linker phase, when the correct code cannot be found.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 | |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
Quote:
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
When you say 'libraries', did you mean it, or did you mean header files. It's a typical warning for missing header files.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Dec 2005
Posts: 15
Rep Power: 0
![]() |
Okay, dumbness on my part... I had originally included ctype.h, then went back and removed it for some reason. It's back in place and working fine now. So, purely user error. Thanks for pointing me in the right direction DaWei.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|