Issue 76377
Summary Clang should not warn about exact-width specifiers for printf
Labels clang
Assignees
Reporter sstwcw
    Compiling this code gives a warning.  I expect no warning.  GCC does not give a warning since version 13.  It looks like the front end does not recognize that specifiers for exact-width types are allowed.

```C
#include <stdint.h>
#include <stdio.h>

int main(void) {
 printf("%w64d\n", INT64_C(0));
  return 0;
}
```

```
clang -Wall -std=c2x print.c
print.c:5:13: warning: invalid conversion specifier '6' [-Wformat-invalid-specifier]
 5 |   printf("%w64d\n", INT64_C(0));
      | ~~^
```

My version is 18.0.0git 6452395561ea.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to