-
Notifications
You must be signed in to change notification settings - Fork 508
Open
Description
Describe the issue
MSYS2 Clang miscompiles va_start
.
Steps to Reproduce the Problem
- Compile this file with Clang in MSYS2. Optimizations neither break nor fix the issue.
#include <stdarg.h>
#include <stdio.h>
void my_printf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
}
int main(void)
{
my_printf("%s\n", "Hello, world!");
}
- Run it.
- Garbage is outputted to the console.
- Note that GCC compiles it fine, so it is not a libc problem.
Additional Context: Operating System, Screenshots
$ clang -v
clang version 11.0.0 (https://github.com/msys2/MSYS2-packages a5a028a0811f03c8f9697bf80c2e28111628ffff)
Target: x86_64-pc-windows-msys
Thread model: posix
InstalledDir: /usr/bin
Also reported here at LLVM: https://bugs.llvm.org/show_bug.cgi?id=48624
Metadata
Metadata
Assignees
Labels
No labels