-
Notifications
You must be signed in to change notification settings - Fork 2
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 redeclaration of RecordDecl in Records defined in array variables #4
Fix redeclaration of RecordDecl in Records defined in array variables #4
Conversation
There are some cases where a variable is declared as follows: static const struct mount_opts { int token; int mount_opts; int flags; } ext4_mount_opts[] = { {1, 1, 1} }; in this case, the `ext4_mount_opts` array is declared together with its type, thus resulting in Clang splitting this into two decls in its AST: struct mount_opts { int token; int mount_opts; int flags; }; static const struct ext4_mount_opts[] = { {1, 1, 1} }; but since we try to get what the user wrote, it results in two declarations of `struct mount_opts`, thus clang-extract fails because of a redeclaration error. But since `ext4_mount_opts` is an array, geting its type returns an array type, not the struct declaration itself, hence check for this case as well. Signed-off-by: Giuliano Belinassi <[email protected]>
Now it shows a different issue regarding symbol renaming =/ |
What issue? |
With the resolved issue, now it reports missing symbol:
But the symbol is there, and it's also present in the ext4.ko module too. |
This seems to be another issue. Perhaps open another issue with more details of this problem? |
Sure, I'll check this again once I start working on this livepatch again. |
@giulianobelinassi indeed, the error message changes, and it's not a different issue. You can merge this PR as this fixed the original issue. |
There are some cases where a variable is declared as follows:
in this case, the
ext4_mount_opts
array is declared together with its type, thus resulting in Clang splitting this into two decls in its AST:but since we try to get what the user wrote, it results in two declarations of
struct mount_opts
, thus clang-extract fails because of a redeclaration error. But sinceext4_mount_opts
is an array, geting its type returns an array type, not the struct declaration itself, hence check for this case as well.