aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect2.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-12-21 11:20:17 +0100
committerJakub Jelinek <jakub@redhat.com>2023-12-21 11:21:40 +0100
commitb99353c33f09201e3cee34387cee6cdccbe31660 (patch)
tree9acffffc50bb1f87568af1fbc2f74056b88ffaa3 /gcc/collect2.cc
parent803d222e533efbc385411d4b5a2d0ec0551b9f16 (diff)
downloadgcc-b99353c33f09201e3cee34387cee6cdccbe31660.zip
gcc-b99353c33f09201e3cee34387cee6cdccbe31660.tar.gz
gcc-b99353c33f09201e3cee34387cee6cdccbe31660.tar.bz2
Fix -Wcalloc-transposed-args warning in collect2.cc and work around -Walloc-size warning
This fixes one warning and works around another one where we allocate less than what we cast to. 2023-12-21 Jakub Jelinek <jakub@redhat.com> * gimple-fold.cc (maybe_fold_comparisons_from_match_pd): Use unsigned char buffers for lhs1 and lhs2 instead of allocating them through XALLOCA. * collect2.cc (maybe_run_lto_and_relink): Swap xcalloc arguments.
Diffstat (limited to 'gcc/collect2.cc')
-rw-r--r--gcc/collect2.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/collect2.cc b/gcc/collect2.cc
index c943f9f..70e6ca9 100644
--- a/gcc/collect2.cc
+++ b/gcc/collect2.cc
@@ -622,7 +622,7 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst,
LTO object replaced by all partitions and other LTO
objects removed. */
- lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args);
+ lto_c_argv = (char **) xcalloc (num_lto_c_args, sizeof (char *));
lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv);
*lto_c_ptr++ = lto_wrapper;