If you are writing a library, please do make sure that a simple program like
#include <yourlib.h>
int main() {
return 0;
}
compiles without any warnings whatsoever even when the compiler is running in the most pedantic mode with all optional warnings enabled.
If you are writing an application, your code throwing warnings left and right is just your application's problem. With a library's public header file, however, everybody who later uses that library will be forced to ignore or endure the warnings your header file is causing.
So please check that your library headers compile without warnings, if possible in multiple compiler modes:
$ gcc -Wall -Wextra -Werror -std=c99 -pedantic
$ gcc -Wall -Wextra -Werror -std=gnu99 -pedantic
$ gcc -Wall -Wextra -Werror -std=c89 -pedantic
$ gcc -Wall -Wextra -Werror -std=gnu89 -pedantic
How many warnings compiling your library throws is again only your problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…