diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-06-25 13:59:15 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-07-26 14:19:51 -0400 |
commit | 2cd69d3ee34a6d2c21aa64aedf262827eb83826f (patch) | |
tree | 9e98b40ac2a7fc6809f7e2bb3ac0c42eecad735a /src/parse.c | |
parent | 1b1e5a4707d681e4b38df56e83db1be9c07723b8 (diff) | |
download | bfs-2cd69d3ee34a6d2c21aa64aedf262827eb83826f.tar.xz |
Use C23 [[attribute]] syntax
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/parse.c b/src/parse.c index 5ec4c0e..febab7f 100644 --- a/src/parse.c +++ b/src/parse.c @@ -138,7 +138,7 @@ static void highlight_args(const struct bfs_ctx *ctx, char **argv, size_t argc, /** * Print an error message during parsing. */ -_printf(2, 3) +[[_printf(2, 3)]] static void parse_error(const struct bfs_parser *parser, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -156,7 +156,7 @@ static void parse_error(const struct bfs_parser *parser, const char *format, ... /** * Print an error about some command line arguments. */ -_printf(4, 5) +[[_printf(4, 5)]] static void parse_argv_error(const struct bfs_parser *parser, char **argv, size_t argc, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -174,7 +174,7 @@ static void parse_argv_error(const struct bfs_parser *parser, char **argv, size_ /** * Print an error about conflicting command line arguments. */ -_printf(4, 5) +[[_printf(4, 5)]] static void parse_conflict_error(const struct bfs_parser *parser, const struct bfs_expr *expr1, const struct bfs_expr *expr2, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -193,7 +193,7 @@ static void parse_conflict_error(const struct bfs_parser *parser, const struct b /** * Print an error about an expression. */ -_printf(3, 4) +[[_printf(3, 4)]] static void parse_expr_error(const struct bfs_parser *parser, const struct bfs_expr *expr, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -208,7 +208,7 @@ static void parse_expr_error(const struct bfs_parser *parser, const struct bfs_e /** * Print a warning message during parsing. */ -_printf(2, 3) +[[_printf(2, 3)]] static bool parse_warning(const struct bfs_parser *parser, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -229,7 +229,7 @@ static bool parse_warning(const struct bfs_parser *parser, const char *format, . /** * Print a warning about conflicting command line arguments. */ -_printf(4, 5) +[[_printf(4, 5)]] static bool parse_conflict_warning(const struct bfs_parser *parser, const struct bfs_expr *expr1, const struct bfs_expr *expr2, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -251,7 +251,7 @@ static bool parse_conflict_warning(const struct bfs_parser *parser, const struct /** * Print a warning about an expression. */ -_printf(3, 4) +[[_printf(3, 4)]] static bool parse_expr_warning(const struct bfs_parser *parser, const struct bfs_expr *expr, const char *format, ...) { const struct bfs_ctx *ctx = parser->ctx; @@ -995,16 +995,16 @@ static struct bfs_expr *parse_time(struct bfs_parser *parser, int field, int arg switch (*tail) { case 'w': time *= 7; - _fallthrough; + [[fallthrough]]; case 'd': time *= 24; - _fallthrough; + [[fallthrough]]; case 'h': time *= 60; - _fallthrough; + [[fallthrough]]; case 'm': time *= 60; - _fallthrough; + [[fallthrough]]; case 's': break; default: @@ -1973,7 +1973,7 @@ static int parse_mode(const struct bfs_parser *parser, const char *mode, struct who = 0; mask = 0777; state = MODE_WHO; - _fallthrough; + [[fallthrough]]; case MODE_WHO: switch (*i) { @@ -2000,7 +2000,7 @@ static int parse_mode(const struct bfs_parser *parser, const char *mode, struct case MODE_EQUALS: expr->file_mode &= ~who; expr->dir_mode &= ~who; - _fallthrough; + [[fallthrough]]; case MODE_PLUS: expr->file_mode |= file_change; expr->dir_mode |= dir_change; @@ -2010,7 +2010,7 @@ static int parse_mode(const struct bfs_parser *parser, const char *mode, struct expr->dir_mode &= ~dir_change; break; } - _fallthrough; + [[fallthrough]]; case MODE_ACTION: if (who == 0) { @@ -2095,7 +2095,7 @@ static int parse_mode(const struct bfs_parser *parser, const char *mode, struct break; case 'x': file_change |= mask & 0111; - _fallthrough; + [[fallthrough]]; case 'X': dir_change |= mask & 0111; break; @@ -2158,7 +2158,7 @@ static struct bfs_expr *parse_perm(struct bfs_parser *parser, int field, int arg ++mode; break; } - _fallthrough; + [[fallthrough]]; default: expr->mode_cmp = BFS_MODE_EQUAL; break; |