collect2.c dead variable?

Robert Lipe robertl@dgii.com
Fri Feb 20 20:12:00 GMT 1998


Earlier this week I was staring at collect2.c for other reasons and
came across what sure looks like a dead variable.  I see the character
pointer declared.  I see it xcalloc()ed and written into.  I never see
the buffer actually referenced.  Becuase it is written into (but never
read) even -Wall can't complain about this.

Can anyone think of a reason to not nuke 'full_real_ld_suffix'?

RJL


RCS file: /egcs/carton/cvsfiles/egcs/gcc/collect2.c,v
retrieving revision 1.19
diff -u -p -r1.19 collect2.c
--- collect2.c  1998/02/20 12:31:00     1.19
+++ collect2.c  1998/02/21 04:08:33
@@ -960,9 +960,6 @@ main (argc, argv)
   char *ld_suffix      = "ld";
   char *full_ld_suffix = ld_suffix;
   char *real_ld_suffix = "real-ld";
-#ifdef CROSS_COMPILE
-  char *full_real_ld_suffix = real_ld_suffix;
-#endif
   char *collect_ld_suffix = "collect-ld";
   char *nm_suffix      = "nm";
   char *full_nm_suffix = nm_suffix;
@@ -1107,12 +1104,6 @@ main (argc, argv)
   strcpy (full_ld_suffix, target_machine);
   strcat (full_ld_suffix, "-");
   strcat (full_ld_suffix, ld_suffix);
-
-  full_real_ld_suffix
-    = xcalloc (strlen (real_ld_suffix) + strlen (target_machine) + 2, 1);
-  strcpy (full_real_ld_suffix, target_machine);
-  strcat (full_real_ld_suffix, "-");
-  strcat (full_real_ld_suffix, real_ld_suffix);

 #if 0
   full_gld_suffix




More information about the Gcc mailing list