aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-02-22 20:21:21 +0000
committergingerBill <bill@gingerbill.org>2024-02-22 20:21:21 +0000
commit00fc4c4e1bfea6b61e8b869a61a4f0560b1931dd (patch)
tree8e96538b1e961098794aa944554fbe12cff7f7a0 /src/check_type.cpp
parent9ea11da00f65a7b69c2cdf55bc7625713e0bd374 (diff)
Make that warning an error with `-vet-style`
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 6e10798f3..dd77031a3 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1105,7 +1105,13 @@ gb_internal void check_bit_field_type(CheckerContext *ctx, Type *bit_field_type,
}
}
if (all_ones && all_booleans) {
- warning(node, "This 'bit_field' might be better expressed as a 'bit_set' since all of the fields are booleans, of 1-bit in size, and the backing type is an integer");
+ if (build_context.vet_flags & VetFlag_Style) {
+ char const *msg = "This 'bit_field' is better expressed as a 'bit_set' since all of the fields are booleans, of 1-bit in size, and the backing type is an integer (-vet-style)";
+ error(node, msg);
+ } else {
+ char const *msg = "This 'bit_field' might be better expressed as a 'bit_set' since all of the fields are booleans, of 1-bit in size, and the backing type is an integer";
+ warning(node, msg);
+ }
}
}
}