Skip to content

ctags: filterSketchSource: enlarge buffer size to handle long lines #2935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Jun 16, 2025

Fixes arduino/ArduinoCore-zephyr#140

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

When parsing the preprocessed file, only the lines relevant for the sketch are preserved.
However, golang's scanner fails if a line is too long for its buffer.
Overcome the issue by adding a 1MB buffer (extremely conservative) and a non-fatal error message in case it's still not enough.

What is the current behavior?

Compiling any sketch from https://github.com/arduino/ArduinoCore-zephyr fails to create prototypes due to analogPins macro, which expands into a ~90K characters line

What is the new behavior?

The prototypes are created correctly

Does this PR introduce a breaking change, and is titled accordingly?

No breaking change

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zephyr Arduino Builds are not creating the function prototypes, like other builds...
1 participant