https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89911
JunMa <JunMa at linux dot alibaba.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |JunMa at linux dot alibaba.com --- Comment #1 from JunMa <JunMa at linux dot alibaba.com> --- diff --git a/gcc/calls.c b/gcc/calls.c index 63c1bc5..d940ec8 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1556,6 +1556,8 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp) return; unsigned nargs = call_expr_nargs (exp); + if (nargs == 0) + return; /* The bound argument to a bounded string function like strncpy. */ tree bound = NULL_TREE; this patch fixes it.