Opened 6 years ago

Closed 6 years ago

#1581 closed defect (duplicate)

Build issue in GCC

Reported by: Fabian Franz BSc Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.14.x
Keywords: gcc Cc:
uname -a: Linux fabian 4.16.15-1-hardened #1 SMP PREEMPT Tue Jun 12 02:43:57 CEST 2018 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.14.0
built by clang 6.0.0 (tags/RELEASE_600/final)
built with OpenSSL 1.1.0h 27 Mar 2018
TLS SNI support enabled
configure arguments: --add-module=../naxsi/naxsi_src --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --user=http --group=http --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --http-client-body-temp-path=/var/lib/nginx/client-body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-cc-opt='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now --with-compat --with-debug --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-stream --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-cc=clang

Description

Distribution: Arch Linux

First of all - clang works (see the output above) but when GCC is used, the following error message appears:

Output GCC 8.1.1 20180531 (GCC)

src/http/ngx_http_script.c: In Funktion »ngx_http_script_add_copy_code«:
src/http/ngx_http_script.c:698:18: Fehler: unvollständiger Funktionstyp »size_t (*)(ngx_http_script_engine_t *)« {alias »long unsigned int (*)(struct <anonym> *)«} kann nicht nach »void (*)(ngx_http_script_engine_t *)« {alias »void (*)(struct <anonym> *)«} umgewandelt werden [-Werror=cast-function-type]

code->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;


src/http/ngx_http_script.c: In Funktion »ngx_http_script_add_var_code«:
src/http/ngx_http_script.c:787:18: Fehler: unvollständiger Funktionstyp »size_t (*)(ngx_http_script_engine_t *)« {alias »long unsigned int (*)(struct <anonym> *)«} kann nicht nach »void (*)(ngx_http_script_engine_t *)« {alias »void (*)(struct <anonym> *)«} umgewandelt werden [-Werror=cast-function-type]

code->code = (ngx_http_script_code_pt) ngx_http_script_copy_var_len_code;


src/http/ngx_http_script.c: In Funktion »ngx_http_script_add_capture_code«:
src/http/ngx_http_script.c:1181:18: Fehler: unvollständiger Funktionstyp »size_t (*)(ngx_http_script_engine_t *)« {alias »long unsigned int (*)(struct <anonym> *)«} kann nicht nach »void (*)(ngx_http_script_engine_t *)« {alias »void (*)(struct <anonym> *)«} umgewandelt werden [-Werror=cast-function-type]

code->code = (ngx_http_script_code_pt)


src/http/ngx_http_script.c: In Funktion »ngx_http_script_add_full_name_code«:
src/http/ngx_http_script.c:1296:18: Fehler: unvollständiger Funktionstyp »size_t (*)(ngx_http_script_engine_t *)« {alias »long unsigned int (*)(struct <anonym> *)«} kann nicht nach »void (*)(ngx_http_script_engine_t *)« {alias »void (*)(struct <anonym> *)«} umgewandelt werden [-Werror=cast-function-type]

code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code;


cc1: Alle Warnungen werden als Fehler behandelt
make[1]: * [objs/Makefile:1118: objs/src/http/ngx_http_script.o] Fehler 1
make[1]: Verzeichnis „/home/bonsai/Programme/nginx-1.14.0“ wird verlassen
make:
* [Makefile:8: build] Fehler 2

Translation:
Fehler: unvollständiger Funktionstyp ... kann nicht nach ... umgewandelt werden => Error: incomplete function type ... cannot be converted to ... .

Change History (1)

comment:1 by Valentin V. Bartenev, 6 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #1546.

Note: See TracTickets for help on using tickets.