-
-
Notifications
You must be signed in to change notification settings - Fork 9
pragma __builtin_warn_bad_printf_format
IsaacShelton edited this page Nov 13, 2022
·
3 revisions
pragma __builtin_warn_bad_printf_format
is a pragma directive that's used to mark printf-like functions.
Functions marked will have their format
argument and variadic arguments checked at compile-time.
The format is checked against the format used by the standard printf(String, ...)
function from 2.7/terminal.adept
.
Although it's similar to printf(*ubyte, ...)
, the format of printf(String, ...)
isn't completely the same!
- The marked function must have an argument named
format
that is of typeString
- The marked function must be variadic and use Adept-style varargs
- The
format
argument should be the last argument before the variadic arguments
pragma __builtin_warn_bad_printf_format
func myPrintfToFile(file *FILE, format String, arguments ...) int {
}