From 2cd69d3ee34a6d2c21aa64aedf262827eb83826f Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 25 Jun 2025 13:59:15 -0400 Subject: Use C23 [[attribute]] syntax --- src/color.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/color.c') 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; -- cgit v1.2.3