summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-07-08 11:51:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-13 22:23:44 +0200
commitbd96a6f7b7eb103f97bcd6eadc21908187e94dce (patch)
treec4ace9ff4cab817915c9b00496a79e83ea2f7a34 /compilerplugins
parenta3c3ab7394f578340c33e6e1cd8da13196a8b596 (diff)
Don't rely on Python's treatment of unrecognized escape sequences
According to [1]: > Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning. > In a future Python version they will be a SyntaxWarning and eventually a SyntaxError. [1] https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals Change-Id: Ia4f79f17ccb121f423f35b1e1306d5ae285e8762 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'compilerplugins')
-rwxr-xr-xcompilerplugins/clang/constantparam.py2
-rwxr-xr-xcompilerplugins/clang/finalclasses.py4
-rwxr-xr-xcompilerplugins/clang/pahole-all-classes.py8
3 files changed, 7 insertions, 7 deletions
diff --git a/compilerplugins/clang/constantparam.py b/compilerplugins/clang/constantparam.py
index a2a8207781be..78abc6a76b48 100755
--- a/compilerplugins/clang/constantparam.py
+++ b/compilerplugins/clang/constantparam.py
@@ -38,7 +38,7 @@ def RepresentsInt(s):
except ValueError:
return False
-constructor_regex = re.compile("^\w+\(\)$")
+constructor_regex = re.compile(r"^\w+\(\)$")
tmp1list = list()
tmp2list = list()
diff --git a/compilerplugins/clang/finalclasses.py b/compilerplugins/clang/finalclasses.py
index 524aec6f48a2..68c94d6d324b 100755
--- a/compilerplugins/clang/finalclasses.py
+++ b/compilerplugins/clang/finalclasses.py
@@ -32,8 +32,8 @@ with open("workdir/loplugin.finalclasses.log") as txt:
else:
print( "unknown line: " + line)
-match_module_inc1 = re.compile('^\w+/inc/')
-match_module_inc2 = re.compile('^\w+/.*/inc/')
+match_module_inc1 = re.compile(r'^\w+/inc/')
+match_module_inc2 = re.compile(r'^\w+/.*/inc/')
tmpset = set()
for clazz in sorted(definitionSet - inheritFromSet):
file = definitionToFileDict[clazz]
diff --git a/compilerplugins/clang/pahole-all-classes.py b/compilerplugins/clang/pahole-all-classes.py
index 9f9ca86a237c..6037287a82ca 100755
--- a/compilerplugins/clang/pahole-all-classes.py
+++ b/compilerplugins/clang/pahole-all-classes.py
@@ -99,11 +99,11 @@ with open("compilerplugins/clang/pahole.results", "wt") as f:
_thread.start_new_thread( write_pahole_commands, (currClassList,) )
- firstLineRegex = re.compile("/\*\s+(\d+)\s+\*/ struct") # /* 16 */ struct Foo
- fieldLineRegex = re.compile("/\*\s+(\d+)\s+(\d+)\s+\*/ ") # /* 12 8 */ class rtl::OUString aName
- holeLineRegex = re.compile("/\* XXX (\d+) bit hole, try to pack \*/")
+ firstLineRegex = re.compile(r"/\*\s+(\d+)\s+\*/ struct") # /* 16 */ struct Foo
+ fieldLineRegex = re.compile(r"/\*\s+(\d+)\s+(\d+)\s+\*/ ") # /* 12 8 */ class rtl::OUString aName
+ holeLineRegex = re.compile(r"/\* XXX (\d+) bit hole, try to pack \*/")
# sometimes pahole can't determine the size of a sub-struct, and then it returns bad data
- bogusLineRegex = re.compile("/\*\s+\d+\s+0\s+\*/")
+ bogusLineRegex = re.compile(r"/\*\s+\d+\s+0\s+\*/")
structLines = list()
foundHole = False
cumulativeHoleBits = 0