Skip to content

Handle a missing -P/--preinclude file the same as an INCLUDE#1873

Merged
Rangi42 merged 1 commit intogbdev:masterfrom
Rangi42:generate-preinclude
Dec 8, 2025
Merged

Handle a missing -P/--preinclude file the same as an INCLUDE#1873
Rangi42 merged 1 commit intogbdev:masterfrom
Rangi42:generate-preinclude

Conversation

@Rangi42
Copy link
Contributor

@Rangi42 Rangi42 commented Dec 8, 2025

  • If dependencies are not being generated, then a missing preinclude file is a regular error, which continues parsing but prevents final assembly.
  • With -MG (to exit normally at the first missing dependency), a missing preinclude file prints its dependency and immediately exits normally.
  • With -MC (to continue after missing dependencies), a missing preinclude file prints its dependency and continues parsing.

@Rangi42 Rangi42 added this to the 1.0.1 milestone Dec 8, 2025
@Rangi42 Rangi42 added bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM labels Dec 8, 2025
@Rangi42
Copy link
Contributor Author

Rangi42 commented Dec 8, 2025

-MG, before:

$ rgbasm -Weverything -Bcollapse -M - -o /dev/null @exits-after-missing-preinclude/a.flags exits-after-missing-preinclude/a.asm
/dev/null: exits-after-missing-preinclude/a.asm
/dev/null: nonexistent-pre.inc
error: Error reading pre-included file "nonexistent-pre.inc": No such file or directory
    at exits-after-missing-preinclude/a.asm(0)
/dev/null: never reaches here
Assembly aborted with 1 error!

-MG, after:

$ ../../rgbasm -Weverything -Bcollapse -M - -o /dev/null @exits-after-missing-preinclude/a.flags exits-after-missing-preinclude/a.asm
/dev/null: exits-after-missing-preinclude/a.asm
/dev/null: nonexistent-pre.inc

-MC, before:

$ rgbasm -Weverything -Bcollapse -M - -o /dev/null @continues-after-missing-preinclude/a.flags continues-after-missing-preinclude/a.asm
/dev/null: continues-after-missing-preinclude/a.asm
/dev/null: nonexistent-pre.inc
error: Error reading pre-included file "nonexistent-pre.inc": No such file or directory
    at continues-after-missing-preinclude/a.asm(0)
/dev/null: nonexistent1.inc
warning: still going! [-Wuser]
    at continues-after-missing-preinclude/a.asm(7)
/dev/null: nonexistent2.inc
warning: and going! [-Wuser]
    at continues-after-missing-preinclude/a.asm(9)
Assembly aborted with 1 error!

-MC, after:

$ ../../rgbasm -Weverything -Bcollapse -M - -o /dev/null @continues-after-missing-preinclude/a.flags continues-after-missing-preinclude/a.asm
/dev/null: continues-after-missing-preinclude/a.asm
/dev/null: nonexistent-pre.inc
/dev/null: nonexistent1.inc
warning: still going! [-Wuser]
    at continues-after-missing-preinclude/a.asm(7)
/dev/null: nonexistent2.inc
warning: and going! [-Wuser]
    at continues-after-missing-preinclude/a.asm(9)

@Rangi42 Rangi42 merged commit b0e0dfc into gbdev:master Dec 8, 2025
24 checks passed
@Rangi42 Rangi42 deleted the generate-preinclude branch December 8, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant