Modify ↓
#1383 closed Bug (No Bug)
AU3Check: false warning.
| Reported by: | anonymous | Owned by: | Jos |
|---|---|---|---|
| Milestone: | Component: | Au3Check | |
| Version: | 3.3.2.0 | Severity: | None |
| Keywords: | AU3Check declared | Cc: |
Description
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Global $var1 $var1 = 0 Func fun() Local $var2 $var2 = 0 EndFunc fun() ;~ (?) WARNING: $var2: declared, but not used in func. ;~ >"C:\...\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\...\_TEST_2.au3" /autoit3dir "C:\...\AutoIt3" /UserParams ;~ +>19:57:35 Starting AutoIt3Wrapper v.2.0.0.3 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86) ;~ >Running AU3Check (1.54.19.0) params:-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 from:C:\...\AutoIt3 ;~ C:\...\_TEST_2.au3(9,13) : WARNING: $var2: declared, but not used in func. ;~ Local $var2 ;~ ~~~~~~~~~~~^ ;~ C:\...\_TEST_2.au3 - 0 error(s), 1 warning(s) ;~ ->19:57:35 AU3Check ended.rc:1 ;~ +>19:57:37 AutoIt3Wrapper Finished ;~ >Exit code: 0 Time: 2.215
Attachments (0)
Change History (5)
comment:1 by , 16 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , 16 years ago
Ok, I think I see the logic of it.
In that case I should put in a additional question mark.
(?) no warning for $var1.
comment:4 by , 16 years ago
Au3Check makes no determination between non-Const and Const when it does its check for usage. Thus if it were to test Global variables you would get several hundred warnings for files with a lot of Global Const variables. Local variables (Const or not) can safely be tested for use because there aren't going to be hundreds of unused constants at function scope.
Note:
See TracTickets
for help on using tickets.

The warning is correct. The variable is never used and there are no side effects to either assignment statement. You can remove the variable and the code will behave exactly the same.