Open YuxinHan258 opened 2 years ago
http-parser的编译同时打开了-Wall -Wextra -Werror。 把http-parser库里的makefile中的 -Werror 去掉就行
This warning notifies the programmer about the fall through. This warning option can be controlled with the GCC compiler switch -Wimplicit-fallthrough. It is not enabled by default and is not enabled by -Wall, but it is enabled by -Wextra.
Warnings become errors if the -Werror switch is used. -Werror is not enabled by default.
C++17 introduced [[fallthrough]] attribute, which can be used to explicitly document the fall through when it is intentional. The compiler should not warn if it is used.
感谢,我已经放弃使用这个工具了
我遇上了同样的问题,但是每次用vi 把Makefile 里的-Werror 去掉后,一跑 ./configure, 那-Werror 又回到 Makefile 里面。
@[farmountain] 你删错地方了,要vim ./3rdparty/http-parser-2.1.zip 中的Makefile。
./configure 报错内容
Is OSX: NO st-1.9t is ok. build http-parser-2.1 cc -I. -DHTTP_PARSER_STRICT=1 -Wall -Wextra -Werror -O0 -g -c http_parser.c http_parser.c: In function ‘http_parser_parse_url’: http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 2093 | found_at = 1; |
~~~^http_parser.c:2096:7: note: here 2096 | case s_req_server: | ^~~~ cc1: all warnings being treated as errors make: *** [Makefile:35:http_parser.o] 错误 1 build http-parser-2.1 failed, ret=2