http://llvm.org/bugs/show_bug.cgi?id=16812

            Bug ID: 16812
           Summary: static analyzer should warn on use of va_arg() macro
                    before call to va_start() macro or after call to
                    va_end() macro
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

It would be nice if the static analyzer gave a warning about use of va_arg()
before the call to va_start() and one about use of va_arg() after the call to
va_end() with this code:


static void func(const char *format, ...)
{
    va_list arguments;

    int x = va_arg(arguments, int);

    va_start (arguments, format);

    vprintf(format, arguments);

    va_end (arguments);

    int y = va_arg(arguments, int);

    printf("x + y = %d\n", (x + y));
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to