summaryrefslogtreecommitdiffstats
path: root/src/color.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/color.c
parent1b1e5a4707d681e4b38df56e83db1be9c07723b8 (diff)
downloadbfs-2cd69d3ee34a6d2c21aa64aedf262827eb83826f.tar.xz
Use C23 [[attribute]] syntax
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/color.c b/src/color.c
index 926cf2b..2d0fc9c 100644
--- a/src/color.c
+++ b/src/color.c
@@ -32,7 +32,8 @@ struct esc_seq {
/** The length of the escape sequence. */
size_t len;
/** The escape sequence itself, without a terminating NUL. */
- char seq[] _counted_by(len);
+ [[_counted_by(len)]]
+ char seq[];
};
/**
@@ -48,7 +49,8 @@ struct ext_color {
/** Whether the comparison should be case-sensitive. */
bool case_sensitive;
/** The extension to match (NUL-terminated). */
- char ext[]; // _counted_by(len + 1);
+ // [[_counted_by(len + 1)]]
+ char ext[];
};
struct colors {
@@ -1387,7 +1389,7 @@ static int print_link_target(CFILE *cfile, const struct BFTW *ftwbuf) {
}
/** Format some colored output to the buffer. */
-_printf(2, 3)
+[[_printf(2, 3)]]
static int cbuff(CFILE *cfile, const char *format, ...);
/** Print an expression's name, for diagnostics. */
@@ -1471,7 +1473,7 @@ static int print_expr(CFILE *cfile, const struct bfs_expr *expr, bool verbose, i
return 0;
}
-_printf(2, 0)
+[[_printf(2, 0)]]
static int cvbuff(CFILE *cfile, const char *format, va_list args) {
const struct colors *colors = cfile->colors;