summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-27 15:02:01 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-27 15:02:01 +0200
commit64f25adb6bbb6002dce837243e3915e45af385cf (patch)
tree38078cd3dfe50353848b62689e390b8a43fdaa59
parentb17ecc1e0212bb22e9bcfd9999701ab1a5e873c5 (diff)
downloadphp-git-64f25adb6bbb6002dce837243e3915e45af385cf.tar.gz
Remove -Wunused-result warnings
-rw-r--r--sapi/phpdbg/phpdbg.c2
-rw-r--r--sapi/phpdbg/phpdbg.h2
-rw-r--r--sapi/phpdbg/phpdbg_bp.c4
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c16
-rw-r--r--sapi/phpdbg/phpdbg_io.c8
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c4
-rw-r--r--sapi/phpdbg/phpdbg_sigsafe.c4
-rw-r--r--sapi/phpdbg/phpdbg_utils.c9
8 files changed, 24 insertions, 25 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index d92f1ab4dc..51e6899e4e 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 ac9e80946b..ed18e7ba55 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 7a6a66b50e..7e8292b066 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 69b08f33ec..f01f765045 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 246431ff2d..baec0ac0f8 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 9d40d000c2..9253576f01 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 319c9a5e75..82cb7aba01 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 4d45066cfa..d0a24986a9 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];