From 0d6814525ebf7c8d45ad951f07aea9b6d54ccad7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Jun 2018 11:34:58 +0200 Subject: [PATCH 1/2] fix build error [-Werror=format-security] --- ext/src/FutureSession.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/src/FutureSession.c b/ext/src/FutureSession.c index 408297c1..3c622f6e 100644 --- a/ext/src/FutureSession.c +++ b/ext/src/FutureSession.c @@ -37,7 +37,7 @@ PHP_METHOD(FutureSession, get) if (self->exception_message) { zend_throw_exception_ex(exception_class(self->exception_code), - self->exception_code TSRMLS_CC, self->exception_message); + self->exception_code TSRMLS_CC, "%s", self->exception_message); return; } @@ -71,7 +71,7 @@ PHP_METHOD(FutureSession, get) } zend_throw_exception_ex(exception_class(self->exception_code), - self->exception_code TSRMLS_CC, self->exception_message); + self->exception_code TSRMLS_CC, "%s", self->exception_message); return; } From fd60ca80f16f7cff098cc637c91cf9188a033c2e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Jun 2018 11:44:56 +0200 Subject: [PATCH 2/2] fix some build warnings [-WFormat] --- ext/php_driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/php_driver.c b/ext/php_driver.c index b9663f8d..14b7a31d 100644 --- a/ext/php_driver.c +++ b/ext/php_driver.c @@ -325,7 +325,7 @@ throw_invalid_argument(zval *object, if (cls_name) { zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, "%s must be %s, an instance of %.*s given", - object_name, expected_type, cls_len, cls_name); + object_name, expected_type, (int)cls_len, cls_name); #if PHP_MAJOR_VERSION >= 7 zend_string_release(str); #else @@ -367,7 +367,11 @@ PHP_INI_MH(OnUpdateLogLevel) } else { php_error_docref(NULL TSRMLS_CC, E_NOTICE, PHP_DRIVER_NAME " | Unknown log level '%s', using 'ERROR'", +#if PHP_MAJOR_VERSION >= 7 + ZSTR_VAL(new_value)); +#else new_value); +#endif cass_log_set_level(CASS_LOG_ERROR); } }