Fix Clang -Wpedantic warning
Needs ReviewPublic

Authored by kfunk on Oct 27 2017, 7:11 AM.

Details

Reviewers
rjvbb
Summary
/home/kfunk/devel/src/kf5/purpose/src/plugins/phabricator/phabricatorjobs.cpp:104:40: warning: use of non-standard escape character '\[' [-Wpedantic]
    QRegExp unwanted(QString::fromUtf8(COLOURCODES));
                                       ^
/home/kfunk/devel/src/kf5/purpose/src/plugins/phabricator/phabricatorjobs.cpp:38:28: note: expanded from macro 'COLOURCODES'
#define COLOURCODES "\u001B\[[0-9]*m"
                           ^~

Diff Detail

Repository
R495 Purpose Library
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
kfunk created this revision.Oct 27 2017, 7:11 AM
kfunk added a reviewer: rjvbb.Oct 27 2017, 7:11 AM

Can't test this myself, so I'm putting this up for review.

rjvbb added a comment.Oct 27 2017, 8:39 AM

Can't test this myself, so I'm putting this up for review.

Yes, you can, or at least you should have been able to (assuming you have arcanist set up appropriately). A few quick checks suggest that arc may have evolved to recognise when it is not printing to a terminal. Please check without the colour code filtering following the instructions below. Arcanist is easy enough to update that we don't need to continue to support older versions (in principle).

From within a git working copy:

${build.dir}/src/plugins/phabricator/testphabricator --list

Or use ${build.dir}/tests/tool/sharetool <patchfile> (which may not even need to be called from inside a git working copy). In the Phabricator plugin dialog, click "Update" to enable the drop-down list that should contain your current open items, without any funny characters beyond the "needs review" and "accepted" glyphs.

src/plugins/phabricator/phabricatorjobs.cpp
39

I almost missed that additional backslash. That's almost certainly going to make a difference; please compare the actual content. The true fix would be to find the accepted alternative notation for \[ (but see the main comment).