]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix clang warning (-Wstring-plus-int)
authorMartin Liska <mliska@suse.cz>
Wed, 21 Apr 2021 14:52:17 +0000 (16:52 +0200)
committerMartin Liska <mliska@suse.cz>
Wed, 21 Apr 2021 14:53:39 +0000 (16:53 +0200)
This fixes:

lto-plugin.c:642:7: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]

lto-plugin/ChangeLog:

* lto-plugin.c (exec_lto_wrapper): Make a temp variable.

lto-plugin/lto-plugin.c

index 32478f070e8128ab72ccb7b0ab3af98b384c3da7..4e90ce03ade210c8753ce78419ac45f94b61c72b 100644 (file)
@@ -636,10 +636,10 @@ exec_lto_wrapper (char *argv[])
 
   /* Write argv to a file to avoid a command line that is too long
      Save the file locally on save-temps.  */
+  const char *suffix = ".lto_wrapper_args";
+  suffix += skip_in_suffix;
   if (save_temps && link_output_name)
-    arguments_file_name = concat (link_output_name,
-                                 ".lto_wrapper_args"
-                                 + skip_in_suffix, NULL);
+    arguments_file_name = concat (link_output_name, suffix, NULL);
   else
     arguments_file_name = make_temp_file (".lto_wrapper_args");
   check (arguments_file_name, LDPL_FATAL,