]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid a warning of overflow
authorQian Jianhua <qianjh@cn.fujitsu.com>
Fri, 18 Mar 2022 09:37:28 +0000 (17:37 +0800)
committerQian Jianhua <qianjh@cn.fujitsu.com>
Mon, 21 Mar 2022 10:15:46 +0000 (18:15 +0800)
This patch avoid a warning of "c-ada-spec.cc:1660:34: warning:
'sprintf' may write a terminating nul past the end of the
destination [-Wformat-overflow=]" when build GCC.

gcc/c-family/ChangeLog:

* c-ada-spec.cc: Change array length

gcc/c-family/c-ada-spec.cc

index 149d336ee967184e619fc4eff220a528e17530ae..aeb429136b6ab4f2f07f6ee677ad746a146aa27c 100644 (file)
@@ -1579,7 +1579,7 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func,
   tree type = TREE_TYPE (func);
   tree arg = TYPE_ARG_TYPES (type);
   tree t;
-  char buf[17];
+  char buf[18];
   int num, num_args = 0, have_args = true, have_ellipsis = false;
 
   /* Compute number of arguments.  */