Bug #78566 [NEW]: compiler warnings with GCC9

From: Date: Thu, 19 Sep 2019 13:24:04 +0000
Subject: Bug #78566 [NEW]: compiler warnings with GCC9
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222828@lists.php.net to get a copy of this message
From: bugreports at gmail dot com Operating system: PHP version: 7.4Git-2019-09-19 (Git) Package: Compile Warning Bug Type: Bug Bug description:compiler warnings with GCC9 Description: ------------ current 7-4 HEAD throws an unusual amount of compiler warnings compared to 7.2 with GCC 9.2.1 In file included from /usr/include/string.h:494, from /BUILD/php-7.4.0/main/php_config.h:2362, from /BUILD/php-7.4.0/ext/date/lib/timelib_config.h:4, from /BUILD/php-7.4.0/ext/date/lib/timelib.h:30, from /BUILD/php-7.4.0/ext/date/lib/parse_tz.c:26: In function 'strncpy', inlined from 'create_location_table' at /BUILD/php-7.4.0/ext/date/lib/parse_tz.c:604:9: /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 64 equals destination size [-Wstringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/openssl/xp_ssl.c: In function 'php_openssl_sockop_set_option': /BUILD/php-7.4.0/ext/openssl/xp_ssl.c:2050:4: warning: 'peer_cert' may be used uninitialized in this function [-Wmaybe-uninitialized] 2050 | X509_free(peer_cert); | ^~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/openssl/xp_ssl.c:1923:8: note: 'peer_cert' was declared here 1923 | X509 *peer_cert; | ^~~~~~~~~ In file included from /BUILD/php-7.4.0/Zend/zend_types.h:25, from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/main/SAPI.c:24: /BUILD/php-7.4.0/main/SAPI.c: In function 'sapi_add_request_header': /BUILD/php-7.4.0/Zend/zend_portability.h:365:10: warning: 'use_heap' may be used uninitialized in this function [-Wmaybe-uninitialized] 365 | do { if (UNEXPECTED(use_heap)) efree(p); } while (0) | ^ /BUILD/php-7.4.0/main/SAPI.c:1111:14: note: 'use_heap' was declared here 1111 | ALLOCA_FLAG(use_heap) | ^~~~~~~~ /BUILD/php-7.4.0/Zend/zend_portability.h:357:12: note: in definition of macro 'ALLOCA_FLAG' 357 | zend_bool name; | ^~~~ Zend/zend_ini_scanner.l: In function 'ini_lex': Zend/zend_ini_scanner.c:520:18: warning: 'yych' may be used uninitialized in this function [-Wmaybe-uninitialized] 520 | goto *yytarget[yych]; | ~~~~~~~~^~~~~~ Zend/zend_ini_scanner.c:388:10: note: 'yych' was declared here 388 | YYCTYPE yych; | ^~~~ Zend/zend_language_scanner.l: In function 'lex_scan': Zend/zend_language_scanner.c:1841:18: warning: 'yych' may be used uninitialized in this function [-Wmaybe-uninitialized] 1841 | goto *yytarget[yych]; | ~~~~~~~~^~~~~~ Zend/zend_language_scanner.c:1255:10: note: 'yych' was declared here 1255 | YYCTYPE yych; | ^~~~ In file included from /BUILD/php-7.4.0/Zend/zend_types.h:25, from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/intl/collator/collator_is_numeric.h:21, from /BUILD/php-7.4.0/ext/intl/collator/collator_is_numeric.c:18: /BUILD/php-7.4.0/ext/intl/collator/collator_is_numeric.c: In function 'collator_u_strtod': /BUILD/php-7.4.0/Zend/zend_portability.h:365:10: warning: 'use_heap' may be used uninitialized in this function [-Wmaybe-uninitialized] 365 | do { if (UNEXPECTED(use_heap)) efree(p); } while (0) | ^ /BUILD/php-7.4.0/ext/intl/collator/collator_is_numeric.c:74:15: note: 'use_heap' was declared here 74 | ALLOCA_FLAG(use_heap); | ^~~~~~~~ /BUILD/php-7.4.0/Zend/zend_portability.h:357:12: note: in definition of macro 'ALLOCA_FLAG' 357 | zend_bool name; | ^~~~ In file included from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from ext/intl/php_intl.h:23, from /BUILD/php-7.4.0/ext/intl/spoofchecker/spoofchecker_main.c:21: /BUILD/php-7.4.0/ext/intl/spoofchecker/spoofchecker_main.c: In function 'zim_Spoofchecker_areConfusable': /BUILD/php-7.4.0/Zend/zend_types.h:776:18: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] 776 | (b) ? IS_TRUE : IS_FALSE; \ | ^ /BUILD/php-7.4.0/ext/intl/spoofchecker/spoofchecker_main.c:61:6: note: 'ret' was declared here 61 | int ret; | ^~~ In file included from /usr/include/string.h:494, from /BUILD/php-7.4.0/include/../main/php_config.h:2362, from /BUILD/php-7.4.0/Zend/zend_config.h:1, from /BUILD/php-7.4.0/Zend/zend_portability.h:43, from /BUILD/php-7.4.0/Zend/zend_types.h:25, from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/pdo/pdo_dbh.c:27: In function 'strncpy', inlined from 'pdo_raise_impl_error' at /BUILD/php-7.4.0/ext/pdo/pdo_dbh.c:59:2: /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 6 equals destination size [-Wstringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 6 equals destination size [-Wstringop-truncation] In file included from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/readline/readline_cli.c:24: /BUILD/php-7.4.0/ext/readline/readline_cli.c: In function 'cli_get_prompt': /BUILD/php-7.4.0/Zend/zend.h:214:12: warning: '__orig_bailout' may be used uninitialized in this function [-Wmaybe-uninitialized] 214 | JMP_BUF *__orig_bailout = EG(bailout); \ | ^~~~~~~~~~~~~~ /BUILD/php-7.4.0/Zend/zend.h:214:12: note: '__orig_bailout' was declared here 214 | JMP_BUF *__orig_bailout = EG(bailout); \ | ^~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/readline/readline_cli.c:190:5: note: in expansion of macro 'zend_try' 190 | zend_try { | ^~~~~~~~ /BUILD/php-7.4.0/ext/readline/readline_cli.c:184:10: warning: 'code' may be used uninitialized in this function [-Wmaybe-uninitialized] 184 | char *code; | ^~~~ /BUILD/php-7.4.0/ext/readline/readline_cli.c:183:10: warning: 'prompt_end' may be used uninitialized in this function [-Wmaybe-uninitialized] 183 | char *prompt_end = strstr(prompt_spec + 1, "`"); | ^~~~~~~~~~ In file included from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/session/session.c:24: /BUILD/php-7.4.0/ext/session/session.c: In function 'zif_session_create_id': /BUILD/php-7.4.0/Zend/zend_types.h:1037:9: warning: 'new_id' may be used uninitialized in this function [-Wmaybe-uninitialized] 1037 | return --(p->refcount); | ^~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/session/session.c:2272:31: note: 'new_id' was declared here 2272 | zend_string *prefix = NULL, *new_id; | ^~~~~~ /BUILD/php-7.4.0/ext/sockets/sockets.c: In function 'zm_startup_sockets': /BUILD/php-7.4.0/ext/sockets/sockets.c:853:13: warning: AI_IDN_ALLOW_UNASSIGNED is deprecated 853 | REGISTER_LONG_CONSTANT("AI_IDN_ALLOW_UNASSIGNED", AI_IDN_ALLOW_UNASSIGNED, CONST_CS | CONST_PERSISTENT); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/sockets/sockets.c:854:13: warning: AI_IDN_USE_STD3_ASCII_RULES is deprecated 854 | REGISTER_LONG_CONSTANT("AI_IDN_USE_STD3_ASCII_RULES", AI_IDN_USE_STD3_ASCII_RULES, CONST_CS | CONST_PERSISTENT); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/sockets/sockets.c: In function 'zif_socket_addrinfo_lookup': /BUILD/php-7.4.0/ext/sockets/sockets.c:2578:13: warning: AI_IDN_ALLOW_UNASSIGNED is deprecated 2578 | if (flags & (AI_IDN_ALLOW_UNASSIGNED | AI_IDN_USE_STD3_ASCII_RULES)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/sockets/sockets.c:2578:13: warning: AI_IDN_USE_STD3_ASCII_RULES is deprecated 2578 | if (flags & (AI_IDN_ALLOW_UNASSIGNED | AI_IDN_USE_STD3_ASCII_RULES)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /BUILD/php-7.4.0/ext/sockets/conversions.c: In function 'from_zval_write_name': /BUILD/php-7.4.0/ext/sockets/conversions.c:732:2: warning: 'family' may be used uninitialized in this function [-Wmaybe-uninitialized] 732 | switch (family) { | ^~~~~~ /BUILD/php-7.4.0/ext/sockets/conversions.c:708:7: note: 'family' was declared here 708 | int family; | ^~~~~~ /BUILD/php-7.4.0/ext/sockets/conversions.c: In function 'from_zval_write_controllen': /BUILD/php-7.4.0/ext/sockets/conversions.c:1117:11: warning: 'len' may be used uninitialized in this function [-Wmaybe-uninitialized] 1117 | uint32_t len; | ^~~ In file included from /BUILD/php-7.4.0/Zend/zend.h:30, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/zip/php_zip.c:24: /BUILD/php-7.4.0/ext/zip/php_zip.c: In function 'php_zip_extract_file.isra.0': /BUILD/php-7.4.0/Zend/zend_alloc.h:161:26: warning: 'file_basename' may be used uninitialized in this function [-Wmaybe-uninitialized] 161 | #define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) | ^~~~~~ /BUILD/php-7.4.0/ext/zip/php_zip.c:152:15: note: 'file_basename' was declared here 152 | zend_string *file_basename; | ^~~~~~~~~~~~~ In file included from /usr/include/string.h:494, from /BUILD/php-7.4.0/include/../main/php_config.h:2362, from /BUILD/php-7.4.0/Zend/zend_config.h:1, from /BUILD/php-7.4.0/Zend/zend_portability.h:43, from /BUILD/php-7.4.0/Zend/zend_types.h:25, from /BUILD/php-7.4.0/Zend/zend.h:27, from /BUILD/php-7.4.0/main/php.h:33, from /BUILD/php-7.4.0/ext/zip/php_zip.c:24: In function 'strncpy', inlined from 'php_zip_glob' at /BUILD/php-7.4.0/ext/zip/php_zip.c:577:2: /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 4096 equals destination size [-Wstringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /BUILD/php-7.4.0/ext/mysqlnd/mysqlnd_wireprotocol.c:26: /BUILD/php-7.4.0/ext/mysqlnd/mysqlnd_wireprotocol.c: In function 'php_mysqlnd_rowp_read_binary_protocol': /BUILD/php-7.4.0/ext/mysqlnd/mysqlnd_statistics.h:90:11: warning: 'statistic' may be used uninitialized in this function [-Wmaybe-uninitialized] 90 | if (_s1 != _p_s->count) MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(_p_s, _s1, v1); \ | ^~ /BUILD/php-7.4.0/ext/mysqlnd/mysqlnd_wireprotocol.c:1470:32: note: 'statistic' was declared here 1470 | enum_mysqlnd_collected_stats statistic; | ^~~~~~~~~ /usr/bin/ld: ext/apcu/.libs/apc_mmap.o: in function `apc_mmap.cold': apc_mmap.c:(.text.unlikely+0x3c): warning: the use of `mktemp' is dangerous, better use mkstemp' or mkdtemp' copying selected object files to avoid basename conflicts... -- Edit bug report at https://bugs.php.net/bug.php?id=78566&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78566&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78566&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78566&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78566&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78566&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78566&r=support Expected behavior: https://bugs.php.net/fix.php?id=78566&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78566&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78566&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78566&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78566&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78566&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78566&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78566&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78566&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78566&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78566&r=mysqlcfg

« previous php.bugs (#222828) next »