misc.py: removed bailouts

This commit is contained in:
Daniel Marjamäki 2018-04-20 08:18:49 +02:00
parent 795f244804
commit 86a9deffbf
2 changed files with 1 additions and 22 deletions

View File

@ -63,14 +63,6 @@ def stringConcatInArrayInit(rawTokens):
elif tok1 == ']' and tok2 == '=' and tok3 == '{':
arrayInit = True
elif arrayInit and (tok1 in [',', '{']) and isStringLiteral(tok2) and isStringLiteral(tok3):
if tok1 == '{':
i2 = i + 1
while i2 < len(rawTokens) and rawTokens[i2].str not in [',', '}']:
i2 = i2 + 1
if i2 >= len(rawTokens) or rawTokens[i2].str != ',':
continue
if i + 2 < len(rawTokens) and isStringLiteral(rawTokens[i+1].str) and isStringLiteral(rawTokens[i+2].str):
continue
reportError(rawTokens[i], 'style', 'String concatenation in array initialization, missing comma?', 'stringConcatInArrayInit')
def implicitlyVirtual(data):

View File

@ -3,21 +3,8 @@
// Warn about string concatenation in array initializers..
const char *a[] = {"a" "b"};
const char *a[] = {"a" "b"}; // stringConcatInArrayInit
const char *b[] = {"a","b" "c"}; // stringConcatInArrayInit
const char *c[] = {
"a\n"
"a\n"
"a\n"
"a\n"
"a\n"
,
"b\n"
"b\n"
"b\n"
"b\n"
"b\n"
};
// Function is implicitly virtual