https://stackoverflow.com/questions/43423803/document-classification-tool-in-c-compilation-error/43432470#43432470文档分类工具 - 在嵌套函数/范围编译错误(可以是)
在上述链路 我加入-fnested_functions作为
GCC -c ./rainbow后得到3个错误。 ç-fnested函数process_wv.c test_file.c test_hdb_file.c
(3档process_wv,test_file里面,test_hdb_file从rainbow.c移除和现在加入作为单独的.c文件的目录)
输出: -
./bow/libbow.h:1345:8: note: forward declaration of 'struct argp_child'
struct argp_child; /* forward declare this type */
^
./rainbow.c:655:5: error: function definition is not allowed here
{
^
./rainbow.c:663:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
#endif VPC_ONLY
^
//
./rainbow.c:734:3: warning: implicit declaration of function 'do_indexing' is invalid in C99
[-Wimplicit-function-declaration]
do_indexing();
^
./rainbow.c:1175:49: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between
pointers to integer types with different sign [-Wpointer-sign]
newsockfd = accept(rainbow_sockfd, &cli_addr, &clilen);
^~~~~~~
/usr/include/sys/socket.h:681:69: note: passing argument to parameter here
int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
^
./rainbow.c:1586:30: error: use of undeclared identifier 'test_file'
bow_map_filenames_from_dir (test_file.c, 0, dir, "");
^
PS为什么test_file.c不明(在docnames.c bow_map_filenames_from_dir)在rainbow.c即使它们是相同的弓20020213文件夹内(权限是755所有)
问候