Issue 182175
Summary [CIR] Incorrect prototype sometimes generated for undeclared variadic functions
Labels good first issue, ClangIR
Assignees
Reporter andykaylor
    When a call to `printf` is made without an explicit declaration, we sometimes generate an incorrect CIR declaration for the function.

This code currently results in a verifier error because printf is declared as non-variadic function:

```
char temp[] = "some str";
int foo(const char *);
int bar(void) {
  int t = foo(temp);
  printf ("Hello %d!\n", t);
  printf ("Works!\n");
 return 0;
}
```

By contrast, the correct variadic declaration is generated in this case:

```
int foo();
int bar(void) {
  int t = foo();
  printf ("Hello %d!\n", t);
  printf ("Works!\n");
  return 0;
}

```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to