In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Nginx compile time hint error: assignment makes pointer from integer without a cast how to deal with", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "Nginx compile time hint error: assignment makes pointer from integer without a cast how to deal with it"!
Nginx upgrade-from nginx-1.8.1 to nginx-1.12.2
It turned out to be compiled and installed by source code.
During the upgrade process, the make Times was wrong.
……
C/http-I src/http/modules\
-o objs/src/http/modules/ngx_http_stub_status_module.o\
Src/http/modules/ngx_http_stub_status_module.c
Cc-c-pipe-O-W-Wall-Wpointer-arith-Wno-unused-parameter-Werror-I src/core-I src/event-I src/event/modules-I src/os/unix-I / data/pcre-8.37-I objs-I src/http-I src/http/modules\
-o objs/addon/nginx-sticky-module-1.25/ngx_http_sticky_module.o\
/ data/nginx-sticky-module-1.25/ngx_http_sticky_module.c
Cc1: warnings being treated as errors
/ data/nginx-sticky-module-1.25/ngx_http_sticky_module.c: In function 'ngx_http_get_sticky_peer':
/ data/nginx-sticky-module-1.25/ngx_http_sticky_module.c:340: error: assignment makes pointer from integer without a cast
Make [1]: * * [objs/addon/nginx-sticky-module-1.25/ngx_http_sticky_module.o] Error 1
Make [1]: Leaving directory `/ data/nginx-1.12.2'
Make: * * [build] Error 2
[root@test01 nginx-1.12.2] #
Refer to the online materials to modify the document and solve the problem successfully.
First revision:
The 281 line of ngx_http_sticky_misc.c is modified as follows
Original
Digest- > len = ngx_sock_ntop (in, digest- > data, len, 1)
After modification
Digest- > len = ngx_sock_ntop (in, sizeof (struct sockaddr_in), digest- > data, len, 1)
The ngx_http_sticky_module.c file is also modified
Line 6 adds:
# include
Modify (iphp- > rrp.current = iphp- > selected_peer;) around line 340 as follows:
If (peer & & selected_peer > = 0) {
Ngx_log_debug (NGX_LOG_DEBUG_HTTP, pc- > log, 0, "[sticky/get_sticky_peer] peer found at index I", selected_peer)
# if defined (nginx_version) & & nginx_version > = 1009000
Iphp- > rrp.current = peer
# else
Iphp- > rrp.current = iphp- > selected_peer
# endif
But there is a new error when compiling again:
Rc/http-I src/http/modules\
-o objs/addon/nginx-sticky-module-1.25/ngx_http_sticky_misc.o\
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c: In function 'ngx_http_sticky_misc_md5':
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:152: error: 'MD5_DIGEST_LENGTH' undeclared (first use in this function)
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:152: error: (Each undeclared identifier is reported only once
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:152: error: for each function it appears in.)
Cc1: warnings being treated as errors
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:152: error: unused variable 'hash'
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c: In function 'ngx_http_sticky_misc_hmac_md5':
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:189: error: 'MD5_DIGEST_LENGTH' undeclared (first use in this function)
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:190: error: 'MD5_CBLOCK' undeclared (first use in this function)
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:190: error: unused variable 'k'
/ data/nginx-sticky-module-1.25/ngx_http_sticky_misc.c:189: error: unused variable 'hash'
Make [1]: * * [objs/addon/nginx-sticky-module-1.25/ngx_http_sticky_misc.o] Error 1
Make [1]: Leaving directory `/ data/nginx-1.12.2'
Make: * * [build] Error 2
[root@test01 nginx-1.12.2] #
The second amendment:
Two new modules are added to ngx_http_sticky_misc.c and
# include
# include
# include
# include
# include
# include
# include
# include
# include "ngx_http_sticky_misc.h"
Then recompile it and it won't go wrong.
At this point, I believe that you have a deeper understanding of "Nginx compile time hint error: assignment makes pointer from integer without a cast how to deal with", might as well to actual operation it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.