summaryrefslogtreecommitdiffstats
path: root/src/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-06-25 13:59:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-07-26 14:19:51 -0400
commit2cd69d3ee34a6d2c21aa64aedf262827eb83826f (patch)
tree9e98b40ac2a7fc6809f7e2bb3ac0c42eecad735a /src/printf.c
parent1b1e5a4707d681e4b38df56e83db1be9c07723b8 (diff)
downloadbfs-2cd69d3ee34a6d2c21aa64aedf262827eb83826f.tar.xz
Use C23 [[attribute]] syntax
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/printf.c b/src/printf.c
index 30ec201..f9fca64 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -91,7 +91,7 @@ static bool should_color(CFILE *cfile, const struct bfs_fmt *fmt) {
(void)ret
/** Return a dynamic format string. */
-_format_arg(2)
+[[_format_arg(2)]]
static const char *dyn_fmt(const char *str, const char *fake) {
bfs_assert(strcmp(str + strlen(str) - strlen(fake) + 1, fake + 1) == 0,
"Mismatched format specifiers: '%s' vs. '%s'", str, fake);
@@ -99,7 +99,7 @@ static const char *dyn_fmt(const char *str, const char *fake) {
}
/** Wrapper for fprintf(). */
-_printf(3, 4)
+[[_printf(3, 4)]]
static int bfs_fprintf(CFILE *cfile, const struct bfs_fmt *fmt, const char *fake, ...) {
va_list args;
va_start(args, fake);
@@ -562,7 +562,7 @@ static int bfs_printf_Y(CFILE *cfile, const struct bfs_fmt *fmt, const struct BF
}
/** %Z: SELinux context */
-_maybe_unused
+[[_maybe_unused]]
static int bfs_printf_Z(CFILE *cfile, const struct bfs_fmt *fmt, const struct BFTW *ftwbuf) {
char *con = bfs_getfilecon(ftwbuf);
if (!con) {
@@ -708,7 +708,7 @@ int bfs_printf_parse(const struct bfs_ctx *ctx, struct bfs_expr *expr, const cha
case '+':
case ' ':
must_be_numeric = true;
- _fallthrough;
+ [[fallthrough]];
case '-':
if (strchr(fmt.str, c)) {
bfs_expr_error(ctx, expr);