[clazy] [Bug 391854] New: New check "Avoid duplicated QStringLiterals"

Roman bugzilla_noreply at kde.org
Wed Mar 14 14:12:21 GMT 2018


https://bugs.kde.org/show_bug.cgi?id=391854

            Bug ID: 391854
           Summary: New check "Avoid duplicated QStringLiterals"
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: dismine at gmail.com
                CC: smartins at kde.org
  Target Milestone: ---

I found two articles about QStringLiteral:
https://woboq.com/blog/qstringliteral.html and
http://blog.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral/. According to
them there is binary overhead. For plain literals and QLatin1String, compilers
try to consolidate identical literals so that they are not duplicated. For
QStringLiteral, identical strings cannot be merged.

It would be nice to have a check that can warn about this overhead. I am not
sure which level to use to search duplicates (unit or whole project), but
probably it should be possible at least mimic compiler optimization and warn
about such cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list