Files
c3c/test/test_suite/attributes/format_attr.c3
Christoffer Lerno d760378b02 - Added @format attribute for compile time printf validation #2057.
- Bug when printing a boolean value as an integer using printf.
2025-03-24 13:32:44 +01:00

20 lines
499 B
Plaintext

fn void foo(int x) @format(1) // #error: The format '@format()'
{}
alias Foo = fn void(String format, args...) @format(0);
fn usz? printfn(String format, args...) @format(1) // #error: The format string cannot
{
return 0;
}
fn void foo2(int x) @format(0) // #error: '@format()' is only valid for a function
{}
fn void foo3(int x, args...) @format(0) // #error: The '@format()' format
{}
fn void foo4(String #x, args...) @format(0) // #error: '@format()' cannot be used with lazy arguments
{}