com php-src: Constify to void build warning for C++ ext. [-Wwrite-strings]: Zend/zend.c Zend/zend.h

[email protected] (Remi Collet)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    ec31924cd68df4f5591664d487baaba0d01b1daf
Author:    Remi Collet <[email protected]>         Fri, 10 Mar 2017 11:52:26 +0100
Parents:   9ad8e8f8ee207f8c50d1737950a1d848dc409afe
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=ec31924cd68df4f5591664d487baaba0d01b1daf

Log:
Constify to void build warning for C++ ext. [-Wwrite-strings]

Example (with v8js):

/builddir/build/BUILD/php-pecl-v8js-1.3.4/NTS/v8js_class.cc: In function 'void v8js_execute_script(zval*, v8js_script*, long int, long int, long int, zval**)':
/usr/include/php/Zend/zend.h:204:57: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 #define zend_bailout()  _zend_bailout(__FILE__, __LINE__)
                                                         ^
/builddir/build/BUILD/php-pecl-v8js-1.3.4/NTS/v8js_class.cc:633:3: note: in expansion of macro 'zend_bailout'
   zend_bailout();
   ^~~~~~~~~~~~

Changed paths:
  M  Zend/zend.c
  M  Zend/zend.h


Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index f99a580..d51bd27 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -983,7 +983,7 @@ ZEND_COLD void zenderror(const char *error) /* {{{ */
 /* }}} */
 
 BEGIN_EXTERN_C()
-ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint32_t lineno) /* {{{ */
+ZEND_API ZEND_COLD void _zend_bailout(const char *filename, uint32_t lineno) /* {{{ */
 {
 
 	if (!EG(bailout)) {
diff --git a/Zend/zend.h b/Zend/zend.h
index bf4a662..87d4b8f 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -225,7 +225,7 @@ void zend_register_standard_ini_entries(void);
 void zend_post_startup(void);
 void zend_set_utility_values(zend_utility_values *utility_values);
 
-ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint32_t lineno);
+ZEND_API ZEND_COLD void _zend_bailout(const char *filename, uint32_t lineno);
 
 ZEND_API size_t zend_vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap);
 ZEND_API size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.