Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: LETARTARE on August 28, 2026, 04:12:37 pm

Title: Use of '_T("...")' with 'CB'
Post by: LETARTARE on August 28, 2026, 04:12:37 pm
I just compiled only 'cb-13984' and found 2638 strings '_T("...")' !! (without plugins)
However, since 'wx-3.0' this writing is obsolete.

What would be the advice to gradually delete this writing and how?

As for me, I think research on every target could be a lead.
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on August 28, 2026, 04:20:39 pm
Note :
'_T("")' => 'wxEmptyString'
Title: Re: Use of '_T("...")' with 'CB'
Post by: Miguel Gimenez on August 28, 2026, 04:40:35 pm
I delete them as I pass near (see 13984), but some areas may be tricky (for example, parts of wxSmith creating string arrays).
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on August 28, 2026, 06:39:21 pm
I just dropped off three tickets: 1632, 1633, 1634
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on September 03, 2026, 11:38:28 am
I just provided three fixes (1636, 1637, 1638) to replace
 
Code
'_T("...")' or  'wxT("...")' by '"..."'
for 'autosave', 'classwizard', codecompletion' plugins
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on September 03, 2026, 12:15:36 pm
For those who are interested in research:

Here is the regular expression to use for '_T(' in 'CB'
Research :
Code
 '_T\(("(\\"|[^"])*")\)'
Replace :
Code
'\1'
Note : the ' must not be written
Title: Re: Use of '_T("...")' with 'CB'
Post by: gd_on on September 03, 2026, 04:48:15 pm
Problem with svn 13991.
Apparently, at least in parserthread.cpp, some strings have been changed inside the ?: operator. This does not work.
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on September 03, 2026, 04:55:35 pm
I look immediately...
Title: Re: Use of '_T("...")' with 'CB'
Post by: Miguel Gimenez on September 03, 2026, 05:10:05 pm
Are these errors inside calls to TRACE()?
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on September 03, 2026, 05:11:28 pm
@gd_on
Could you tell me the line or the lines involved ?

Because under 'Leap-15.6, gcc-15.2' I can't find any error in 'parserthread.cpp' when compiling.
Title: Re: Use of '_T("...")' with 'CB'
Post by: gd_on on September 03, 2026, 05:27:43 pm
Yes, all problems are in TRACE : lines 1473, 2347, 2357, 2371, 3200, 3258
Example :
Code
C:\Users\Gerard\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\codecompletion\parser\parserthread.cpp|3258|error: conditional expression between distinct pointer types 'const wxStringCharType*' {aka 'const wchar_t*'} and 'const char*' lacks a cast|
May be there are other problems, but the compiler stops there in parserthread.
Title: Re: Use of '_T("...")' with 'CB'
Post by: Miguel Gimenez on September 03, 2026, 05:30:38 pm
Sacre bleu!   ;D
Title: Re: Use of '_T("...")' with 'CB'
Post by: LETARTARE on September 03, 2026, 05:53:28 pm
@gd_on

Can you try to replace "...." => wxS(".....") or wxString(".....") on these lines ?
Title: Re: Use of '_T("...")' with 'CB'
Post by: Miguel Gimenez on September 03, 2026, 05:59:51 pm
Quote
Yes, all problems are in TRACE : lines 1473, 2347, 2357, 2371, 3200, 3258

Reverted r13991 in these lines, see r13994. Please try to compile again.

I do not know why LETARTARE and I do not get compilation errors while gd_on does.
Title: Re: Use of '_T("...")' with 'CB'
Post by: gd_on on September 03, 2026, 06:11:56 pm
Probably better, but that time an other error still with TRACE :
Code
C:\Users\Gerard\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\codecompletion\parser\parserthread.cpp|2991|error: 'kkm_LastUnnamedTokenName' was not declared in this scope; did you mean 'm_LastUnnamedTokenName'?|
Apparently just kkm_ instead of m_
Title: Re: Use of '_T("...")' with 'CB'
Post by: Miguel Gimenez on September 03, 2026, 06:19:17 pm
Fixed in r13995, sorry. I added "kk" to force an error if TRACE() was active and forgot to remove it.
Title: Re: Use of '_T("...")' with 'CB'
Post by: gd_on on September 03, 2026, 06:37:09 pm
Quote
I do not know why LETARTARE and I do not get compilation errors while gd_on does.
Probably a more or less restrictive compiler: mine is msys2 16.2
Now it's OK.