Example #1
0
def reportError(token, severity, msg, id):
    if id == 'debug' and DEBUG == False:
        return
    if VERIFY:
        VERIFY_ACTUAL.append(str(token.linenr) + ':' + id)
    else:
        cppcheckdata.reportErrorCli(token, severity, msg, 'misc', id)
Example #2
0
def reportError(token, severity, msg, id):
    if VERIFY:
        VERIFY_ACTUAL.append(str(token.linenr) + ':cert-' + id)
    else:
        cppcheckdata.reportErrorCli(token, severity, msg, 'cert', id)
Example #3
0
    print('Checking ' + arg + '...')
    data = cppcheckdata.parsedump(arg)

    for cfg in data.configurations:
        if len(data.configurations) > 1:
            print('Checking ' + arg + ', config "' + cfg.name + '"...')
        for token in cfg.tokenlist:
            if token.str != '(' or not token.astOperand1 or token.astOperand2:
                continue

            # Is it a lambda?
            if token.astOperand1.str == '{':
                continue

            # we probably have a cast.. if there is something inside the parentheses
            # there is a cast. Otherwise this is a function call.
            typetok = token.next
            if not typetok.isName:
                continue

            # cast number => skip output
            if token.astOperand1.isNumber:
                continue

            # void cast => often used to suppress compiler warnings
            if typetok.str == 'void':
                continue

            cppcheckdata.reportErrorCli(token, 'information', 'found a cast',
                                        'findcasts', 'cast')
Example #4
0
def reportError(token, severity, msg, errorId):
    cppcheckdata.reportErrorCli(token, severity, msg, 'naming', errorId)
Example #5
0
def reportError(token, severity, msg, id):
    cppcheckdata.reportErrorCli(token, severity, msg, 'threadsafety', id)