Compile problem

D

Digitalcoup

I have been working on a small application out of boredum and have ran into a
slight problem. In one of the lines I used: if(isblank(u_name[count_element])
== 0) {

at compile time I get the error: warning: implicit declaration of function
`isblank'.

Simple workaround I just used isspace() instead, but I would still like to know
what the problem is. Doing my own investigation I found that
/usr/include/ctype.h does have isblank() is defined and of course the manpage
does show it as being under ctype.h. Now in /usr/include/linux/ctype.h
/usr/lib/bcc/include/ctype.h isspace is not defined at all. Is isblank() a
nonstandard function in ctype? I really don't mind having the easy work around
but I always want to know why something failed that I tried. Any help is
appreciated.
 
J

Jack Klein

I have been working on a small application out of boredum and have ran into a
slight problem. In one of the lines I used: if(isblank(u_name[count_element])
== 0) {

at compile time I get the error: warning: implicit declaration of function
`isblank'.

Simple workaround I just used isspace() instead, but I would still like to know
what the problem is. Doing my own investigation I found that
/usr/include/ctype.h does have isblank() is defined and of course the manpage
does show it as being under ctype.h. Now in /usr/include/linux/ctype.h
/usr/lib/bcc/include/ctype.h isspace is not defined at all. Is isblank() a
nonstandard function in ctype? I really don't mind having the easy work around
but I always want to know why something failed that I tried. Any help is
appreciated.

There is a standard C library function isspace() prototyped in
<ctype.h>, and there has been since the original 1989 ANSI C standard.
There is another function named isblank() that was added to <ctype.h>
by the 1999 major update to the C standard.

Your compiler might be operating in a C89 conforming mode where it
does not recognize newer C99 prototypes. You will need to ask in a
Linux programming group, such as as to how to get your compiler to recognize this. I would suggest you
specify your compiler's version Linux version when you ask there.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
 
D

Digitalcoup

From: Jack Klein

You will need to ask in a
Linux programming group, such as as to how to get your compiler to recognize this. I would suggest you
specify your compiler's version Linux version when you ask there.

Yes, I was just about to post that I found my own answer. I compiled with gcc
-o 'filename' -Wall -Werror -ansi -pedantic -std=c99 'filename.c' and it worked
just fine. Thanks for your input though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top