From 8ab53e65a60cc151ff9b5b48c749d40e0bd58756 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 16 May 2022 11:07:57 +0200 Subject: opts-global.cc: document last change gcc/ChangeLog: * opts-global.cc (write_langs): Add comment. --- gcc/opts-global.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/opts-global.cc b/gcc/opts-global.cc index 4f5f8cd..4355e26 100644 --- a/gcc/opts-global.cc +++ b/gcc/opts-global.cc @@ -61,6 +61,8 @@ write_langs (unsigned int mask) if (mask & (1U << n)) len += strlen (lang_name) + 1; + /* Allocate at least one character as we'll terminate the string + at the very end of this function. */ result = XNEWVEC (char, MAX (1, len)); len = 0; for (n = 0; (lang_name = lang_names[n]) != 0; n++) -- cgit v1.1