com php-src: Remove -Wunused-result warnings: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/ phpdbg_cmd.c
sapi/phpdbg/phpdbg_io.c sapi/phpdbg/ph pdbg_prompt.c sapi/phpdbg/phpdbg_sigsafe.c sapi/php dbg/phpdbg_utils.c
| From: | Bob Weinand | Date: | Mon, 27 Jul 2015 13:02:01 +0000 |
| Subject: | com php-src: Remove -Wunused-result warnings: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/ phpdbg_cmd.c sapi/phpdbg/phpdbg_io.c sapi/phpdbg/ph pdbg_prompt.c sapi/phpdbg/phpdbg_sigsafe.c sapi/php dbg/phpdbg_utils.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88177@lists.php.net to get a copy of this message | ||
Commit: 64f25adb6bbb6002dce837243e3915e45af385cf
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 27 Jul 2015 15:02:01 +0200
Parents: b17ecc1e0212bb22e9bcfd9999701ab1a5e873c5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64f25adb6bbb6002dce837243e3915e45af385cf
Log:
Remove -Wunused-result warnings
Changed paths:
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg.h
M sapi/phpdbg/phpdbg_bp.c
M sapi/phpdbg/phpdbg_cmd.c
M sapi/phpdbg/phpdbg_io.c
M sapi/phpdbg/phpdbg_prompt.c
M sapi/phpdbg/phpdbg_sigsafe.c
M sapi/phpdbg/phpdbg_utils.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index d92f1ab..51e6899 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1814,7 +1814,7 @@ phpdbg_main:
if (PHPDBG_G(ops)) {
phpdbg_print_opcodes(print_opline_func);
} else {
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("No opcodes could be compiled | No file
specified or compilation failed?\n"));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("No opcodes could be compiled | No
file specified or compilation failed?\n"));
}
goto phpdbg_out;
}
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index ac9e809..ed18e7b 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -113,6 +113,8 @@
#define memcpy(...) memcpy_tmp(__VA_ARGS__)
#endif
+#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
+
#if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
#ifdef ZTS
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index 7a6a66b..7e8292b 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -533,12 +533,12 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array) /* {{{
*
opline_break = zend_hash_get_current_data_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
phpdbg_notice("breakpoint", "add=\"success\" id=\"%d\"
symbol=\"%s\" num=\"%ld\" opline=\"%#lx\"", "Breakpoint #%d
resolved at %s%s%s#%ld (opline %#lx)",
- brake->id,
+ opline_break->id,
brake->class_name ? brake->class_name : "",
brake->class_name && brake->func_name ? "::" : "",
brake->func_name ? brake->func_name : "",
brake->opline_num,
- brake->opline);
+ opline_break->opline);
}
} ZEND_HASH_FOREACH_END();
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 69b08f3..f01f765 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -95,35 +95,35 @@ PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **point
{
switch (param->type) {
case STR_PARAM:
- asprintf(pointer, "%s", param->str);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s", param->str));
break;
case ADDR_PARAM:
- asprintf(pointer, ZEND_ULONG_FMT, param->addr);
+ ZEND_IGNORE_VALUE(asprintf(pointer, ZEND_ULONG_FMT, param->addr));
break;
case NUMERIC_PARAM:
- asprintf(pointer, "%li", param->num);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%li", param->num));
break;
case METHOD_PARAM:
- asprintf(pointer, "%s::%s", param->method.class, param->method.name);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s::%s", param->method.class,
param->method.name));
break;
case FILE_PARAM:
if (param->num) {
- asprintf(pointer, "%s:%lu#%lu", param->file.name, param->file.line,
param->num);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s:%lu#%lu", param->file.name,
param->file.line, param->num));
} else {
- asprintf(pointer, "%s:%lu", param->file.name, param->file.line);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s:%lu", param->file.name,
param->file.line));
}
break;
case NUMERIC_FUNCTION_PARAM:
- asprintf(pointer, "%s#%lu", param->str, param->num);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s#%lu", param->str, param->num));
break;
case NUMERIC_METHOD_PARAM:
- asprintf(pointer, "%s::%s#%lu", param->method.class, param->method.name,
param->num);
+ ZEND_IGNORE_VALUE(asprintf(pointer, "%s::%s#%lu", param->method.class,
param->method.name, param->num));
break;
default:
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index 246431f..baec0ac 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -149,7 +149,7 @@ recv_once:
#endif
if (got_now == -1) {
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Read operation timed out!\n"));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Read operation timed out!\n"));
return -1;
}
i -= got_now;
@@ -270,7 +270,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short
wrote = snprintf(buf, 128, "Could not translate address '%s'", addr);
buf[wrote] = '\0';
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
} else {
@@ -280,7 +280,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short
wrote = snprintf(buf, 256, "Host '%s' not found. %s", addr,
estrdup(gai_strerror(rc)));
buf[wrote] = '\0';
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
#ifndef PHP_WIN32
@@ -295,7 +295,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short
wrote = sprintf(buf, "Unable to create socket");
buf[wrote] = '\0';
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
}
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 9d40d00..9253576 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -350,7 +350,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /
char *sys_ini;
int i;
- asprintf(&sys_ini, "%s/" PHPDBG_INIT_FILENAME, PHP_CONFIG_FILE_PATH);
+ ZEND_IGNORE_VALUE(asprintf(&sys_ini, "%s/" PHPDBG_INIT_FILENAME,
PHP_CONFIG_FILE_PATH));
phpdbg_try_file_init(sys_ini, strlen(sys_ini), 0);
free(sys_ini);
@@ -369,7 +369,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /
scan_dir[i] = 0;
}
- asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME);
+ ZEND_IGNORE_VALUE(asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME));
phpdbg_try_file_init(init_file, strlen(init_file), 1);
if (i == -1) {
break;
diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c
index 319c9a5..82cb7ab 100644
--- a/sapi/phpdbg/phpdbg_sigsafe.c
+++ b/sapi/phpdbg/phpdbg_sigsafe.c
@@ -13,13 +13,13 @@ static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t ali
return PHPDBG_G(sigsafe_mem).mem;
}
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Tried to allocate more than "
EXP_STR(PHPDBG_SIGSAFE_MEM_SIZE) " bytes from stack memory in signal handler ... bailing out of
signal handler\n"));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Tried to allocate more than "
EXP_STR(PHPDBG_SIGSAFE_MEM_SIZE) " bytes from stack memory in signal handler ... bailing out of
signal handler\n"));
if (*EG(bailout)) {
LONGJMP(*EG(bailout), FAILURE);
}
- write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Bailed out without a bailout address in
signal handler!\n"));
+ quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Bailed out without a bailout address
in signal handler!\n"));
return NULL;
}
diff --git a/sapi/phpdbg/phpdbg_utils..c b/sapi/phpdbg/phpdbg_utils.c
index 4d45066..d0a2498 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -302,16 +302,13 @@ PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */
#ifndef HAVE_LIBEDIT
/* TODO: libedit doesn't seems to support coloured prompt */
if ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED)) {
- asprintf(
- &PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
PHPDBG_G(colors)[PHPDBG_COLOR_PROMPT]->code,
- PHPDBG_G(prompt)[0]);
+ PHPDBG_G(prompt)[0]));
} else
#endif
{
- asprintf(
- &PHPDBG_G(prompt)[1], "%s ",
- PHPDBG_G(prompt)[0]);
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], "%s ", PHPDBG_G(prompt)[0]));
}
return PHPDBG_G(prompt)[1];