Context
- Version: Harbour 3.2.0dev (r2601171121)
- Platform: Termux / Android 15.0 (ARM64, Clang 21.1.8)
- Build options: (Clipper 5.3b) (Clipper 5.x undoc)
- Installation: Compiled from source (make && make install)
- Environment: /data/data/com.termux/files/usr/bin/harbour and hbpp installed correctly
Problem Description
When compiling a simple PRG file containing functions, Harbour produces phantom errors:
clean.prg(22) Error E0010 ENDIF does not match IF
clean.prg(43) Error E0010 ENDIF does not match IF
even though the code is correct and minimal.
Example:
FUNCTION Test()
IF .T.
? "ok"
ENDIF
RETURN NIL
END FUNCTION
Observed Symptoms
- The generated .ppo file contains lines such as:
- END FUNCTION is transformed into end by the internal preprocessor.
- end is then interpreted as ENDIF, which triggers the errors.
- The external preprocessor (hbpp) is fine: when run directly, it does not produce errors.
- The issue persists even after make clean && make install.
Steps to Reproduce
- Compile Harbour 3.2.0dev (r2601171121) on Termux ARM64/Clang.
- Create a file clean.prg with a simple function (see example above).
- Run:
- Observe the ENDIF does not match IF errors.
Expected Result
The code should compile correctly, generating valid .c and .ppo output without errors.
Actual Result
Harbour fails with phantom ENDIF errors.
Hypothesis
The internal preprocessor enabled by default in this revision (Clipper 5.x compatibility options) incorrectly rewrites END FUNCTION.
The bug seems specific to this configuration (Linux/Clang/ARM64).
Possible Solutions
- Disable the internal PP and force Harbour to use hbpp.
- Fix the internal rule that rewrites END FUNCTION.
- Review default build options in this revision.
Context
Problem Description
When compiling a simple PRG file containing functions, Harbour produces phantom errors:
even though the code is correct and minimal.
Example:
Observed Symptoms
Steps to Reproduce
Expected Result
The code should compile correctly, generating valid .c and .ppo output without errors.
Actual Result
Harbour fails with phantom ENDIF errors.
Hypothesis
The internal preprocessor enabled by default in this revision (Clipper 5.x compatibility options) incorrectly rewrites END FUNCTION.
The bug seems specific to this configuration (Linux/Clang/ARM64).
Possible Solutions