From 5fb582ab7f44f8ead28a95e002042e6cb1e72b00 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Sun, 10 Apr 2022 18:26:14 +0200 Subject: [PATCH] libtcc: Accept "-g0" to disable debug in addition to "-g", "-g1", "-g2" and "-g3" This does not change our generated code. Signed-off-by: Detlef Riekenberg --- libtcc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index f2839d2e..e00c776c 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1827,7 +1827,13 @@ reparse: break; #endif case TCC_OPTION_g: - s->do_debug = 1; + /* Use "-g" as alias for "-g1". Use "-g0" to disable debug */ + /* Other common used values: "-g0", "-g1", "-g2" and "-g3" */ + /* no failure with unsupported options */ + if (isnum(*optarg)) + s->do_debug = atoi(optarg); + else + s->do_debug = 1; break; case TCC_OPTION_c: x = TCC_OUTPUT_OBJ;