Recently, the compilation warning has been cleared for previously written code, but an isblank warning has never been cleared.
The example source code is as follows:
# Include <stdio. h> <br/> # include <ctype. h> <br/> int main () <br/> {<br/> char a = 'a'; <br/> printf ("% d/N ", isblank (a); <br/> printf ("% d/N", isalpha (a); <br/> return 0; <br/>}
Compilation result:
Bash-2.05b # gcc-wall test. c
Test. C: In function 'main ':
Test. C: 9: Warning: Implicit declaration of function 'isblank'
This warning indicates that isblank does not have the corresponding function declaration and must contain the corresponding header file.
Man isblank shows that the header file is ctype. h, but it still does not work.
Later, it was found that this warning was not reported during compilation in a newer Linux release, only in older versions.
Then I took a closer look at man isblank and caught a glimpse of a piece of information in man's information by chance:
Isascii ():
_ Bsd_source | _ svid_source | _ xopen_source
Isblank ():
_ Xopen_source> = 600 | _ isoc99_source | _ posix_c_source> = 2001_l;
Or CC-STD = c99
As you can see, isblank belongs to the c99 standard and can be proved by viewing ctype. h:
/* ISO c99 introduced one new function. */<br/> # ifdef _ use_isoc99 <br/>__ begin_namespace_c99 <br/>__ exctype (isblank); <br/>__ end_namespace_c99 <br/> # endif
Add the compilation option-STD = c99 and re-compile it. The warning is finally cleared:
Bash-2.05b # gcc-wall-STD = c99 test. c
Although the compilation warning has been solved, is there a doubt that GCC does not fully support the c99 standard? I will study it later.