[MDEV-12148] Sphinx : compile error with /Zc:strictStrings Created: 2017-02-28  Updated: 2022-07-09  Resolved: 2022-07-08

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Platform Windows, Storage Engine - SphinxSE
Affects Version/s: 10.0
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-12149 Connect SE: compile errors on Windows... Closed

 Description   

When compilng Sphinx on Windows, with VS2015 and option /Zc:strictStrings, the compilation fails with
errors about converting const char[N] to char *

To reproduce, run cmake with

cmake . -DCMAKE_CXX_FLAGS=/Zc:strictStrings

strictStrings might be made default option in the future.

See related bug in MySQL https://bugs.mysql.com/bug.php?id=85157
Below are the 10.0 errors.

Error	C2440	'initializing': cannot convert from 'const char [7]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2440	'initializing': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1043	
Error	C2440	'initializing': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1311	
Error	C2440	'initializing': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2440	'initializing': cannot convert from 'const char [1]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1311	
Error	C2440	'initializing': cannot convert from 'const char [10]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1042	
Error	C2440	'initializing': cannot convert from 'const char [10]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2439	'CSphUrl::m_sScheme': member could not be initialized	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2439	'CSphUrl::m_sIndex': member could not be initialized	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2439	'CSphUrl::m_sHost': member could not be initialized	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	261	
Error	C2439	'CSphSEQuery::m_sSelect': member could not be initialized	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1311	
Error	C2439	'CSphSEQuery::m_sComment': member could not be initialized	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1311	
Error	C2440	'=': cannot convert from 'const char [34]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	468	
Error	C2440	'=': cannot convert from 'const char [31]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	456	
Error	C2440	'=': cannot convert from 'const char [30]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	474	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1069	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1074	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1096	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\ha_sphinx.cc	1108	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	315	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	320	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	340	
Error	C2440	'=': cannot convert from 'const char [2]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	352	
Error	C2440	'=': cannot convert from 'const char [29]' to 'char *'	sphinx	D:\work\10.1\storage\sphinx\snippets_udf.cc	462	


Generated at Thu Feb 08 07:55:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.