2

When I try to install Crypt::TEA module to perl 5.18 on Windows 7, displayed error:

TEA.xs: In function 'XS_Crypt__TEA_crypt': TEA.xs:58:9: error: invalid use of void expression

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Artem
  • 517
  • 1
  • 7
  • 24

1 Answers1

5

The problem is this line:

    if (SvREADONLY(output) || !SvUPGRADE(output, SVt_PV))
        croak("cannot use output as lvalue");

SvUPGRADE() is a macro with two void operations, it does not return a value. It will croak if it fails. Change it to this:

    if (!SvREADONLY(output)) 
        SvUPGRADE(output, SVt_PV);
Schwern
  • 153,029
  • 25
  • 195
  • 336