Anders
-
2015-12-01
- status: open --> closed-fixed
With the stock LogicLib 2.6, a ${Select} control structure with a single ${Case}, like this:
Name "LogicLib :: Select Case"
OutFile "LogicLib_SelectCase.exe"
RequestExecutionLevel user
!include "${NSISDIR}\Include\LogicLib.nsh"
Section
${Select} 42
${Case} 42
MessageBox MB_OK "Case 42"
${EndSelect}
SectionEnd
is preprocessed into this:
Section
StrCmp `42` `42` `` `_LogicLib_Label_2`
MessageBox MB_OK "Case 42"
_LogicLib_Label_2:
_LogicLib_Label_1:
SectionEnd
which triggers a warning:
label "_LogicLib_Label_1" not used
An obvious workaround is to add a dummy ${Default} case (after finding out where on Earth that unused label is defined, as the warning gives no hint on the subject), but after I saw snippets like
Goto ${_Continue} ; Just to ensure it is referenced at least once
Goto ${_Exit${_n}} ; Just to ensure it is referenced at least once
in other parts of LogicLib, I thought it might be possible to fix this in the library itself, such as:
Section
StrCmp `42` `42` `` `_LogicLib_Label_2`
MessageBox MB_OK "Case 42"
Goto _LogicLib_Label_1 ; Just to ensure it is referenced
_LogicLib_Label_2:
_LogicLib_Label_1:
SectionEnd