Hey it's only taken me 9 years to answer but better late than never!
Running the following version:
CMD.exe on Microsoft Windows [Version 10.0.14393]
TCC LE 14.00.9 x64 Windows 10 [Version 6.3.14393]
I put these four statements in a batch file called if_test.bat.
IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF DEFINED PATH (ECHO 2) ELSE ECHO NOT 2
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF NOT DEFINED XXX (ECHO 4) ELSE ECHO NOT 4
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF DEFINED PATH(ECHO 5)
@ECHO EXIT CODE %ERRORLEVEL% %_?
On CMD, I get this:
C:\src\tcc>if_test
C:\src\tcc>IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
EXIT CODE 0 _?
C:\src\tcc>IF DEFINED PATH (ECHO 2 ) ELSE ECHO NOT 2
2
EXIT CODE 0 _?
C:\src\tcc>IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
'3)' is not recognized as an internal or external command,
operable program or batch file.
EXIT CODE 0 _?
C:\src\tcc>IF NOT DEFINED XXX (ECHO 4 ) ELSE ECHO NOT 4
4
EXIT CODE 0 _?
C:\src\tcc>IF DEFINED PATH(ECHO 5)
EXIT CODE 0 _?
On TCC, I get this:
[C:\src\tcc]if_test.bat
IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
EXIT CODE 0 2
IF DEFINED PATH (ECHO 2) ELSE ECHO NOT 2
2
EXIT CODE 0 0
IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
TCC: C:\src\tcc\if_test.bat [5] Unknown command "ELSE"
EXIT CODE 2 2
IF NOT DEFINED XXX (ECHO 4) ELSE ECHO NOT 4
4
EXIT CODE 2 0
IF DEFINED PATH(ECHO 5)
C:\src\tcc\if_test.bat [9] Usage : IF [/I] [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] command
EXIT CODE 2 1
Test Case 5 is where the difference is apparent. Basically CMD is silent where TCC issues an error. I think it's actually a bug in CMD. Adding the ELSE seemed to change the behavior which is why I wrote cases 1 and 5.
But like I said in my original post, it's pretty minor.
Ron