diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-03 21:20:53 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-03 21:23:24 -0400 |
| commit | 68ed6315829fabc182a8d2e6e73d2b4e6485022b (patch) | |
| tree | e71af8f16b134502f2a45086f1dba81e96395d73 | |
| parent | 8923e28b2a808d553038a5b12849a9878883656b (diff) | |
Forbid multiple uses of `-sanitize`
`clang` does not allow this.
Fixes #4354
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 531bbe98e..ad07c9a12 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1555,6 +1555,11 @@ gb_internal bool parse_build_flags(Array<String> args) { case BuildFlag_Sanitize: GB_ASSERT(value.kind == ExactValue_String); + if (build_context.sanitizer_flags != 0) { + gb_printf_err("-sanitize:<string> may only be used once\n"); + bad_flags = true; + } + if (str_eq_ignore_case(value.value_string, str_lit("address"))) { build_context.sanitizer_flags |= SanitizerFlag_Address; } else if (str_eq_ignore_case(value.value_string, str_lit("memory"))) { @@ -2728,7 +2733,6 @@ gb_internal int print_show_help(String const arg0, String command, String option print_usage_line(3, "-sanitize:address"); print_usage_line(3, "-sanitize:memory"); print_usage_line(3, "-sanitize:thread"); - print_usage_line(2, "NOTE: This flag can be used multiple times."); } } |