config/auto/libffi.pm: Result of _select_lib not used

James E Keenan jkeen at verizon.net
Tue Dec 21 03:04:34 UTC 2010


Tonight I had occasion to notice this code in config/auto/libffi.pm:

  78     my $extra_libs = $self->_select_lib( {
  79         conf            => $conf,
  80         osname          => $osname,
  81         cc              => $conf->data->get('cc'),
  82         default         => $libffi_options_libs . ' ' . 
$libffi_options_cflags,
  83     } );

However, nothing is done with $extra_libs for the balance of the scope 
in which it is declared.  Hence, the call to 
Parrot::Configure::Step::List::_select_lib() is superfluous and could be 
deleted.

My hunch is that the author of the code was trying for something 
different here: perhaps adding a whitespace-delimited string of the 
values of $libffi_options_libs and $libffi_options_cflags to a list of 
flags.  But that's just a guess.

Can anyone clarify?

Thank you very much.
kid51

(Here is a more typical use of _select_lib() from config/auto/readline.pm:

  49     my $extra_libs = $self->_select_lib( {
  50         conf            => $conf,
  51         osname          => $osname,
  52         cc              => $cc,
  53         win32_nongcc    => 'readline.lib',
  54         default         => '-lreadline',
  55     } );
  56
  57     $conf->cc_gen('config/auto/readline/readline_c.in');
  58     my $has_readline = 0;
  59     eval { $conf->cc_build( q{}, $extra_libs ) };



More information about the parrot-dev mailing list