I encountered a few warnings in VA.ahk if I include #Warn in my script. The problem can be simply reproduced in a 3-line script:
#Warn ; Recommended for catching common errors.
#Include VA.ahk
VA_SetMasterVolume(0)
The first warning is
---------------------------
Test.ahk
---------------------------
Warning in #include file "......\VA.ahk":
Using value of uninitialized variable.
Specifically: devices (a local variable)
Line#
357: Loop,count
358: if VA_IMMDeviceCollection_Item(devices, A_Index-1, device) = 0
359: if InStr(VA_GetDeviceName(device), m1) && (m2 = "" || ++index = m2)
360: Goto,VA_GetDevice_Return
361: Else
362: ObjRelease(device), device:=0
365: ObjRelease(deviceEnumerator)
---> 366: if devices
367: ObjRelease(devices)
369: Return,device
370: }
373: {
375: if !VarSetCapacity(PKEY_Device_FriendlyName)
376: VarSetCapacity(PKEY_Device_FriendlyName, 20),VA_GUID(PKEY_Device_FriendlyName :="{A45C254E-DF1C-4EFD-8020-67D146A850E0}"),NumPut(14, PKEY_Device_FriendlyName, 16)
379: VarSetCapacity(prop, 16)
Is this expected behavior (so I can never use #Warn in my script)?
I am using VA.ahk v2.2 and AutoHotkey_L v1.1.09.04. Thank you very much.