-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISO C++ forbids converting a string constant to ‘char*’ #332
Comments
hi @shakaw, We are unable to reproduce the warning. From what I see in our current source code, Please try to build the driver again using the latest version of our driver and let us know if the warning exist. Also, would you mind giving us more context? Which version of our driver are you using? Which version of PHP 7.1 are you using? What platform are you building the driver on? What compiler are you using? |
I'm sorry. It's for driver 4.0.8. New version compiling succesful, but have some warnings: In file included from /opt/remi/php71/root/usr/include/php/main/php_ini.h:24:0, |
What platform are you building the driver on? And what compiler are you using? |
sh-4.1$ uname -a sh-4.1$ /opt/rh/devtoolset-4/root/usr/bin/c++ -v |
We are able to reproduce the warning. We will investigate on this and get back to you. |
The fix should be in the latest release (4.1.8-preview). Please check to see if your problem still exist. |
/var/tmp/sqlsrv/conn.cpp:152:75: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
char* ss_sqlsrv_conn::resource_name = static_cast<char *>("ss_sqlsrv_conn");
/var/tmp/sqlsrv/init.cpp: In function ‘int zm_activate_sqlsrv(int, int)’:
/opt/remi/php71/root/usr/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/opt/remi/php71/root/usr/include/php/Zend/zend_ini.h:142:37: note: in expansion of macro ‘INI_INT’
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
^
/var/tmp/sqlsrv/init.cpp:639:45: note: in expansion of macro ‘INI_BOOL’
SQLSRV_G( warnings_return_as_errors ) = INI_BOOL( INI_PREFIX INI_WARNINGS_RETURN_AS_ERRORS);
^
/opt/remi/php71/root/usr/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/var/tmp/sqlsrv/init.cpp:640:32: note: in expansion of macro ‘INI_INT’
SQLSRV_G( log_severity ) = INI_INT( INI_PREFIX INI_LOG_SEVERITY);
^
/opt/remi/php71/root/usr/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/var/tmp/sqlsrv/init.cpp:641:34: note: in expansion of macro ‘INI_INT’
SQLSRV_G( log_subsystems ) = INI_INT( INI_PREFIX INI_LOG_SUBSYSTEMS);
^
/opt/remi/php71/root/usr/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
The text was updated successfully, but these errors were encountered: