T
tropos
For my sins, I'm maintaining some old C code which is migrated to C++.
Dozens of lines of it looks like this:
char *cfd_THE_ts_result_sql= "select TRADE_DATE , VALUE , "
" from ("
" select to_char(TRADE_DATE,'yyyymmdd') trade_date ,
THEORETICAL_HIGH_VALUE"
" from %s "
" where trade_date = (select max(trade_date ) from %s where "
<snip>
;
The Solaris native C++ compiler complains a lot, saying "Warning:
String literal converted to char* in initialization." Even if I
convert the "char *" to "const char *", a lot of the continuation lines
get that warning. I'd like to get rid of the warnings.
Being a nice C++ coder, I find a line like
char * s1 = "something " "and something else" "and more" ;
pretty wierd. Is this even legitimate C?
Is there any way to concatenate C strings, upon initialisation of a
char *, that won't reap a warning?
Thanks
Tropos
Dozens of lines of it looks like this:
char *cfd_THE_ts_result_sql= "select TRADE_DATE , VALUE , "
" from ("
" select to_char(TRADE_DATE,'yyyymmdd') trade_date ,
THEORETICAL_HIGH_VALUE"
" from %s "
" where trade_date = (select max(trade_date ) from %s where "
<snip>
;
The Solaris native C++ compiler complains a lot, saying "Warning:
String literal converted to char* in initialization." Even if I
convert the "char *" to "const char *", a lot of the continuation lines
get that warning. I'd like to get rid of the warnings.
Being a nice C++ coder, I find a line like
char * s1 = "something " "and something else" "and more" ;
pretty wierd. Is this even legitimate C?
Is there any way to concatenate C strings, upon initialisation of a
char *, that won't reap a warning?
Thanks
Tropos