-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix includes from to ignoring dir.types ##types #14073
Conversation
int len = snprintf (filepath, sizeof (filepath), | ||
"/usr/include/%s", buf); | ||
if (!dirname) { | ||
dirname = "/usr/include"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random though #1: maybe /usr/include is not where we want to look at.. maybe it's just '.' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote that as a fallback, in case dirname wasn't already set as the value on dir.types (it would be a null pointer in that case).
Also, "/usr/include" is the default value for dir.types. Based on C include priorities, it will prioritize a header with the same name located in the current directory than the header file located in the dir.types path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats's what I thought while writing that. Might be wrong, though! :p
@@ -1252,7 +1253,7 @@ static int cmd_type(void *data, const char *input) { | |||
} | |||
} else { | |||
char *error_msg = NULL; | |||
char *out = r_parse_c_file (core->anal, filename, &error_msg); | |||
char *out = r_parse_c_file (core->anal, filename, dir, &error_msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random though #2 - what if we want to add more includedirs? or maybe other options to the parser? the rparse api needs a refactor. and this must be added to the list of things to do at some point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we already set more than one includedir in the eval var, I mean, is that already implemented?
I believe it shouldn't be way too hard to pass a dirlist as the argument, to be parsed by tcc in order to add many include directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Codecov Report
@@ Coverage Diff @@
## master #14073 +/- ##
==========================================
+ Coverage 36.86% 36.87% +<.01%
==========================================
Files 941 941
Lines 304184 304191 +7
==========================================
+ Hits 112150 112156 +6
- Misses 192034 192035 +1
Continue to review full report at Codecov.
|
Fixes #14031