22 lines · c
1// RUN: %clang_dfsan %s -o %t2// RUN: not %run %t 2>&1 | FileCheck %s3// RUN: %run %t foo4 5#include <stdio.h>6 7int do_nothing(const char *format, ...) {8 return 0;9}10 11int main(int argc, char **argv) {12 int (*fp)(const char *, ...);13 14 if (argc > 1)15 fp = do_nothing;16 else17 fp = printf;18 19 // CHECK: FATAL: DataFlowSanitizer: unsupported indirect call to vararg function printf20 fp("hello %s\n", "world");21}22