zxm256 / Nginx-with-GmSSLv3

An modified Nginx with GmSSL
125 stars 37 forks source link

按照项目文档中的步骤编译报错 #41

Closed yanh0606 closed 11 months ago

yanh0606 commented 1 year ago

image 用docker镜像创建的浏览器无法访问,打不开页面,用代码编译按照项目中的编译步骤,结果执行make的时候报错了,错误类似下面这样 /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2002:6: note: expected ‘const uint64_t ()[2][2][8]’ but argument is of type ‘uint64_t ()[2][2][8]’ void sm9_final_exponent(sm9_fp12_t r, const sm9_fp12_t f) ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c: In function ‘sm9_fn_from_hash’: /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2220:11: error: redeclaration of ‘i’ with no linkage for (int i = 0; i < 10; i++) { ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2217:6: note: previous declaration of ‘i’ was here int i, j; ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2220:2: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < 10; i++) { ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2220:2: note: use option -std=c99 or -std=gnu99 to compile your code /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2221:3: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int j = 0; j < 4; j++) { ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c: In function ‘sm9_twist_point_to_uncompressed_octets’: /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2339:2: warning: passing argument 1 of ‘sm9_fp2_to_bytes’ from incompatible pointer type [enabled by default] sm9_fp2_to_bytes(x, octets + 1); ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:479:6: note: expected ‘const uint64_t ()[8]’ but argument is of type ‘uint64_t ()[8]’ void sm9_fp2_to_bytes(const sm9_fp2_t a, uint8_t buf[64]) ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:2340:2: warning: passing argument 1 of ‘sm9_fp2_to_bytes’ from incompatible pointer type [enabled by default] sm9_fp2_to_bytes(y, octets + 32 2 + 1); ^ /root/Nginx-with-GmSSLv3/GmSSL/src/sm9_alg.c:479:6: note: expected ‘const uint64_t ()[8]’ but argument is of type ‘uint64_t (*)[8]’ void sm9_fp2_to_bytes(const sm9_fp2_t a, uint8_t buf[64]) ^ make[2]: [CMakeFiles/gmssl.dir/src/sm9_alg.c.o] Error 1 make[1]: [CMakeFiles/gmssl.dir/all] Error 2 make: *** [all] Error 2

gl8023sh1314 commented 1 year ago

在Nginx-with-GmSSLv3/GmSSL的CMakeLists.txt中添加set(CMAKE_C_FLAGS "-std=c99")

github-actions[bot] commented 1 year ago

Marked as stale issue. Will be closed later if no activity for a while.