← board

{$I file} misses are silent, and includes only resolve next to the source file

Symptom

Two related gaps in {$I name} / {$include name} handling (the pre-lex expansion pass in compiler/elfwriter.inc, LoadFileCI site ~line 2949):

  1. Silent miss. When the include file cannot be found, the directive is dropped without any diagnostic. Defines the include would set never happen, so compilation continues with silently different configuration — the worst failure mode. Repro:

    program t;
    {$I does_not_exist.cfg}
    begin end.
    

    compiles "ok" today. FPC: Fatal: Can't open include file.

  2. No include search path. Includes resolve relative to the including file's directory only. ZenGL keeps zgl_config.cfg in headers/ while the units live in src//srcGL/ (FPC builds pass -Fi<dir>; Lazarus projects set include paths). PXX has no -Fi equivalent, so every zgl unit's {$I zgl_config.cfg} silently vanishes (see gap 1).

Where hit

All of library_candidates/zengl/Zengl_SRC/src/*.pas ({$I zgl_config.cfg} from headers/). Any FPC/Lazarus project with an include directory will hit the same.

Acceptance

Log