On 12/02/2016 02:25 PM, Nathan Sidwell wrote:
+/* Check if we've met the maximum error limit. */
Arguments should be documented.
+void +diagnostic_check_max_errors (diagnostic_context *context, bool flush) +{ + if (!context->max_errors) + return;
I prefer to spell that as != 0 since it's not a boolean, but you can also leave it.
+ int count = (diagnostic_kind_count (context, DK_ERROR) + + diagnostic_kind_count (context, DK_SORRY) + + diagnostic_kind_count (context, DK_WERROR)); + + if (count >= (int) context->max_errors)
Looks like there are some unnecessary type mismatches leading to this cast. Maybe declare max_errors as int and remove the cast?
Otherwise ok. Bernd