feat: warn when loaded file contains no geometry#307
Merged
spe-ciellt merged 2 commits intogerbv:developfrom Mar 7, 2026
Merged
feat: warn when loaded file contains no geometry#307spe-ciellt merged 2 commits intogerbv:developfrom
spe-ciellt merged 2 commits intogerbv:developfrom
Conversation
Add post-parse emptiness check in gerbv_open_image() that emits a WARNING into the image's error list when a Gerber or drill file parses successfully but defines no actual geometry (netlist contains only the sentinel node). This surfaces empty files that some CAD tools generate by mistake, rather than silently loading a blank layer.
This was referenced Mar 3, 2026
spe-ciellt
reviewed
Mar 3, 2026
Contributor
spe-ciellt
left a comment
There was a problem hiding this comment.
Only one thing but in several places.
Address review feedback: wrap individual comparisons in parentheses when combined with && or || operators, per project style preference.
Contributor
Author
|
@spe-ciellt Added parentheses around comparisons in boolean expressions as requested — see latest commit 391db5a. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #259.
gerbv_open_image()that emits aGERBV_MESSAGE_WARNINGwhen a file parses successfully but contains no actual geometry (the net list has only the sentinel node, no real entries)File "..." contains no drill hits or routes(viadrill_stats->error_list)File "..." contains no drawing elements(viagerbv_stats->error_list)src/gerbv.c, no changes to parsersTest plan
cmake --build build— clean build, zero new warningsctest— 94/104 pass (10 pre-existing image mismatches, unchanged)test/inputs/empty.xnc(existing empty drill file) produces the drill warning