Menu ▾ ▴

#604 Senseless variable warning

2.0 Series
closed-fixed
Scripting (211)
2
2015-01-26
2007-04-15
Uwe
No

Attached is a small NSIS-script. Compile it and you get the following warnings:

3 warnings:
unknown variable/constant "OldString" detected, ignoring (macro:WordReplaceCall:4)
unknown variable/constant "NewString" detected, ignoring (macro:WordReplaceCall:5)
install function "ReplaceLineContent" not referenced - zeroing code (139-147) out

The last warning is OK, but the warning for the variables doesn't make sense, because they are not used because the Function isn't called.

Now declare the variables to get rid of the warning, but then you get this warning instead:

Variable "OldString" not referenced, wasting memory!
Variable "NewString" not referenced, wasting memory!

So NSIS gives me in any case warnings I can not get rid of.

Discussion

  • Uwe

    Uwe - 2007-04-15

    test script

     
  • Amir Szekely

    Amir Szekely - 2007-04-15
    • labels: --> Scripting
    • milestone: --> 2.0 Series
    • priority: 5 --> 2
    • assigned_to: nobody --> kichik
    • status: open --> closed-fixed
     
  • Amir Szekely

    Amir Szekely - 2007-04-15

    Logged In: YES
    user_id=584402
    Originator: NO

    It thinks the variables are not referenced because you never set them. You just use them and then they're just as good as an empty string. I've update the warning text to say "or never used".

     

Log in to post a comment.