Skip to content

Improve include resolution fix for older compilers #152

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

Merged
merged 1 commit into from
May 23, 2016

Conversation

matthijskooijman
Copy link
Collaborator

The primary way to detect includes is to scan the compiler error output
for "#include" lines. However, older gcc versions did not print the
error line itself, only a message about the error, which would not be
detected. In bd5d3ec (Fix include resolution for older compilers), a
fallback was added to scan for "fatal error" followed by the missing
include filename, but that fallback only looked at the first line of the
error output.

When the missing #include line is not in the source file being compiled,
but in an included file, the error message would something like this:

In file included from binouts.ino:52:0:
regtable.h:31:22: fatal error: register.h: No such file or directory

So the filename that should be found is in the second line (or further).
This commit changes the fallback process to keep scanning lines of
compiler output, until one is found, instead of only looking at the
first line.

This fixes #97.

Signed-off-by: Matthijs Kooijman matthijs@stdin.nl

The primary way to detect includes is to scan the compiler error output
for "#include" lines. However, older gcc versions did not print the
error line itself, only a message about the error, which would not be
detected. In bd5d3ec (Fix include resolution for older compilers), a
fallback was added to scan for "fatal error" followed by the missing
include filename, but that fallback only looked at the first line of the
error output.

When the missing #include line is not in the source file being compiled,
but in an included file, the error message would something like this:

	In file included from binouts.ino:52:0:
	regtable.h:31:22: fatal error: register.h: No such file or directory

So the filename that should be found is in the second line (or further).
This commit changes the fallback process to keep scanning lines of
compiler output, until one is found, instead of only looking at the
first line.

This fixes arduino#97.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
@ArduinoBot
Copy link
Contributor

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-152.zip

ℹ️ To test this build:

  1. Replace arduino-builder binary (you can find it where you installed the IDE) with the provided one

@cmaglie cmaglie modified the milestone: 1.3.19 May 18, 2016
@cmaglie cmaglie merged commit 5a79106 into arduino:master May 23, 2016
facchinm added a commit that referenced this pull request May 23, 2016
@matthijskooijman matthijskooijman deleted the old-compilers-fix branch May 31, 2016 12:18
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.

Builder is unable to find generic libraries for 3rd party boards
3 participants