Skip to content

END FUNCTION rewritten as 'end' on ARM64/Termux (Harbour 3.2.0dev r2601171121) #401

@bertrandsoullier

Description

@bertrandsoullier

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:

command >end<
  • 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

  1. Compile Harbour 3.2.0dev (r2601171121) on Termux ARM64/Clang.
  2. Create a file clean.prg with a simple function (see example above).
  3. Run:
    harbour -p clean.prg
    
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions