collect2.c dead variable?

Jeffrey A Law law@cygnus.com
Fri Feb 20 21:03:00 GMT 1998


  In message < 19980220221204.42120@dgii.com >you write:
  > 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'?
It looks dead to me:

find . -type f -print | xargs grep full_real_ld_suffix 
./collect2.c:  char *full_real_ld_suffix = real_ld_suffix;
./collect2.c:  full_real_ld_suffix
./collect2.c:  strcpy (full_real_ld_suffix, target_machine);
./collect2.c:  strcat (full_real_ld_suffix, "-");
./collect2.c:  strcat (full_real_ld_suffix, real_ld_suffix);
./ChangeLog:    * collect2.c (full_real_ld_suffix): #ifdef CROSS_COMPILE.
./ChangeLog:    'full_real_ld_suffix'.
./ChangeLog:    Bracket declaration of 'exportf' and 'full_real_ld_suffix'.


The second line is the assignment to full_real_ld_suffix.

I think it ought to get zapped.

jeff



More information about the Gcc mailing list