[Development] FW: Backwards compatibiltiy break in Qt 5.5

Thiago Macieira thiago.macieira at intel.com
Tue Jul 28 21:24:16 CEST 2015


On Tuesday 28 July 2015 21:58:08 NIkolai Marchenko wrote:
> Fact is : you are severly overestimating the amount of cases where
> homoglyph is a problem at the same time severly underestimating the amount
> of code you broke and inconvenience caused by the change.
> The amount of people that has since agreed with my point of view in this
> thread is a testament to that.
> Want homoglyph  debugging? turn on environment variable. Simple as that. At
> the same time peopel with existing code won't be tearing at their hair on
> the prospect of retyping every qdebug instance

I don't think I am underestimating the annoyance to those people nor that I am 
overestimating the benefit. You have also take into account that a great 
majority of source code is written in English and for those cases this feature 
is a net win.

Anyway, I'm waiting for Lars to make a decision.

Lars, you can either make your choices below or you may request consensus and 
then make your decision:

1) qDebug for QStrings should
  a) escape everything non-US-ASCII (5.5.0 behaviour)
  b) escape everything that isn't QChar::isPrint
  c) escape only US-ASCII control characters (0 to 31), backslash and quote
  d) escape only NUL, backslash and quote
  e) escape nothing (5.0 through 5.4 behaviour)
  [I haven't included option f) mangle irrevocably (4.x behaviour)]

2) ditto for qDebug for QByteArrays, except that for:
  b1) escape everything that isn't isprint() from ctype.h (locale dependent)
  b2) escape everything that isn't printable under Latin 1
  Note that QByteArray::toUpper and toLower do not and have never used ctype.h   
  and are instead fixed to Latin 1.

3) QtTest should
  a) follow qDebug and be consistent
  b) do it differently, in which case we need to select which of the options 
      above

4) when to apply those changes, which are technically behaviour changes
  a) 5.5.1
  b) 5.6.0

Note that the QtTest QString change happened in 5.4.0, so I advise against 
changing QTest::toString(QString) in 5.5.1, if a change is to happen.

Obviously my preference has already been stated. If we eliminate 1a, my 
preferences are: 1c and 2a. I do not want QChar::isPrint to be used because 
it's expensive.

Anything except 1e will still change "C:\Users" to "C:\\Users" in the output, 
which was one of the complaints listed.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list