首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
1.8.7-stable编译的时候有warning,需要关心吗?
MAC下比较多 LINUX下一条 LINUX centos6+PHP5.5.31 swoole-src-1.8.7-stable/src/network/Manager.c: 在函数‘swManager_loop_async’中: swoole-src-1.8.7-stable/src/network/Manager.c:313:31: 警告:将一个指针转换为大小不同的整数 [-Wpointer-to-int-cast] new_pid = (pid_t) swHashMap_find_int(pidMap, pid); ^ swoole-src-1.8.7-stable/src/network/Manager.c:363:74: 警告:将一个整数转换为大小不同的指针 [-Wint-to-pointer-cast] swHashMap_add_int(pidMap, reload_workers[i].pid, (void*) new_pid); ^ MAC+php5.5.34 swoole-src-1.8.7-stable/swoole_async.c:366:88: warning: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Wformat] swoole_php_fatal_error(E_WARNING, "offset must be less than file_size[=%ld].", file_stat.st_size); ~~~ ^~~~~~~~~~~~~~~~~ %lld ./php_swoole.h:105:106: note: expanded from macro 'swoole_php_fatal_error' #define swoole_php_fatal_error(level, fmt_str, ...) php_error_docref(NULL TSRMLS_CC, level, fmt_str, ##__VA_ARGS__) ^~~~~~~~~~~ 1 warning generated. swoole-src-1.8.7-stable/swoole_process.c:788:17: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations] RETURN_BOOL(daemon(nochdir, noclose) == 0); ^ /usr/include/stdlib.h:267:6: note: 'daemon' has been explicitly marked deprecated here int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ 1 warning generated. swoole-src-1.8.7-stable/src/core/heap.c:219:51: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] printf("#%d\tpriority=%ld, data=%p\n", i, heap->nodes[i]->priority, heap->nodes[i]->data); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ %llu 1 warning generated. swoole-src-1.8.7-stable/src/network/Server.c:557:13: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations] if (daemon(0, 1) < 0) ^ /usr/include/stdlib.h:267:6: note: 'daemon' has been explicitly marked deprecated here int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ 1 warning generated. swoole-src-1.8.7-stable/src/network/Manager.c:363:74: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] swHashMap_add_int(pidMap, reload_workers[i].pid, (void*) new_pid); ^ 1 warning generated. swoole-src-1.8.7-stable/src/os/base.c:83:60: warning: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Wformat] (aio_event == SW_AIO_READ) ? "READ" : "WRITE", aio_event->offset, (uint64_t) aio_event->nbytes); ^~~~~~~~~~~~~~~~~ swoole-src-1.8.7-stable/src/os/base.c:83:79: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] (aio_event == SW_AIO_READ) ? "READ" : "WRITE", aio_event->offset, (uint64_t) aio_event->nbytes); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. swoole-src-1.8.7-stable/src/os/sendfile.c:41:44: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'off_t *' (aka 'long long *') [-Wincompatible-pointer-types] ret = sendfile(in_fd, out_fd, *offset, &size, &hdtr, 0); ^~~~~ /usr/include/sys/socket.h:605:38: note: passing argument to parameter here int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int); ^ swoole-src-1.8.7-stable/src/os/sendfile.c:49:24: warning: variable 'sent_bytes' is uninitialized when used here [-Wuninitialized] *offset += sent_bytes; ^~~~~~~~~~ swoole-src-1.8.7-stable/src/os/sendfile.c:25:21: note: initialize the variable 'sent_bytes' to silence this warning off_t sent_bytes; ^ = 0 2 warnings generated.
发布于8年前 · 4 次浏览 · 来自
提问
千
千寻
MAC下比较多 LINUX下一条 LINUX centos6+PHP5.5.31 swoole-src-1.8.7-stable/src/network/Manager.c: 在函数‘swManager_loop_async’中: swoole-src-1.8.7-stable/src/network/Manager.c:313:31: 警告:将一个指针转换为大小不同的整数 [-Wpointer-to-int-cast] new_pid = (pid_t) swHashMap_find_int(pidMap, pid); ^ swoole-src-1.8.7-stable/src/network/Manager.c:363:74: 警告:将一个整数转换为大小不同的指针 [-Wint-to-pointer-cast] swHashMap_add_int(pidMap, reload_workers[i].pid, (void*) new_pid); ^ MAC+php5.5.34 swoole-src-1.8.7-stable/swoole_async.c:366:88: warning: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Wformat] swoole_php_fatal_error(E_WARNING, "offset must be less than file_size[=%ld].", file_stat.st_size); ~~~ ^~~~~~~~~~~~~~~~~ %lld ./php_swoole.h:105:106: note: expanded from macro 'swoole_php_fatal_error' #define swoole_php_fatal_error(level, fmt_str, ...) php_error_docref(NULL TSRMLS_CC, level, fmt_str, ##__VA_ARGS__) ^~~~~~~~~~~ 1 warning generated. swoole-src-1.8.7-stable/swoole_process.c:788:17: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations] RETURN_BOOL(daemon(nochdir, noclose) == 0); ^ /usr/include/stdlib.h:267:6: note: 'daemon' has been explicitly marked deprecated here int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ 1 warning generated. swoole-src-1.8.7-stable/src/core/heap.c:219:51: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] printf("#%d\tpriority=%ld, data=%p\n", i, heap->nodes[i]->priority, heap->nodes[i]->data); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ %llu 1 warning generated. swoole-src-1.8.7-stable/src/network/Server.c:557:13: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations] if (daemon(0, 1) < 0) ^ /usr/include/stdlib.h:267:6: note: 'daemon' has been explicitly marked deprecated here int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ 1 warning generated. swoole-src-1.8.7-stable/src/network/Manager.c:363:74: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] swHashMap_add_int(pidMap, reload_workers[i].pid, (void*) new_pid); ^ 1 warning generated. swoole-src-1.8.7-stable/src/os/base.c:83:60: warning: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Wformat] (aio_event == SW_AIO_READ) ? "READ" : "WRITE", aio_event->offset, (uint64_t) aio_event->nbytes); ^~~~~~~~~~~~~~~~~ swoole-src-1.8.7-stable/src/os/base.c:83:79: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] (aio_event == SW_AIO_READ) ? "READ" : "WRITE", aio_event->offset, (uint64_t) aio_event->nbytes); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. swoole-src-1.8.7-stable/src/os/sendfile.c:41:44: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'off_t *' (aka 'long long *') [-Wincompatible-pointer-types] ret = sendfile(in_fd, out_fd, *offset, &size, &hdtr, 0); ^~~~~ /usr/include/sys/socket.h:605:38: note: passing argument to parameter here int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int); ^ swoole-src-1.8.7-stable/src/os/sendfile.c:49:24: warning: variable 'sent_bytes' is uninitialized when used here [-Wuninitialized] *offset += sent_bytes; ^~~~~~~~~~ swoole-src-1.8.7-stable/src/os/sendfile.c:25:21: note: initialize the variable 'sent_bytes' to silence this warning off_t sent_bytes; ^ = 0 2 warnings generated.
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2017-11-08
哈
哈哈
需要,出现警告后建议查找原因排错或重新编译以免遇到不必要的麻烦在后期的开发过程中。
赞
0
回复
2017-11-08
蜗牛之梦
警告不影响编译。
赞
0
回复
2017-11-08
冷
冷云飞
可能环境有点冲突,但不影响正常业务就没所谓了。
赞
0
回复