[cfe-dev] clang missing a warning.

James Courtier-Dutton james.dutton at gmail.com
Fri Jun 28 09:13:02 PDT 2013


Hi,

How do I get clang to detect the following error
#include <stdio.h>

extern test_printf(const char *format, ...);

int main()
{
        int a,b;
        a = 1;
        b = 2;
        test_printf("Hello a=0x%x, b=0x%x, c=0x%x\n", a, b);
        printf("Hello a=0x%x, b=0x%x, c=0x%x\n", a, b);

        return 0;
}

When compiled with:
clang -c -g -O0 -o test.o test.c

It correctly warns about the lack of a third param in the "printf()" line.
How do I get it to warn on the test_printf() line?

Kind Regards

James



More information about the cfe-dev mailing list