Skip to content
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 potentially wrong code by dropping attributes after RecordDecls #14

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

giulianobelinassi
Copy link
Collaborator

Previously, clang-extract dropped attribute(()) after the definition of a RecordDecl. This could possibly generate wrong code if the attribute is relevant for code layout, for example.

@marcosps Please check if it fixes the wrong code on TOMOYO.

Closes #13

Previously, clang-extract dropped __attribute__(()) after the
definition of a RecordDecl. This could possibly generate wrong code
if the __attribute__ is relevant for code layout, for example.

Signed-off-by: Giuliano Belinassi <gbelinassi@suse.de>
@marcosps
Copy link
Collaborator

marcosps commented Apr 3, 2024

The attribute is now copied correctly:

/** clang-extract: from include/linux/sched.h:413:1  */                                                                             
struct sched_avg {                                                                                                                  
        u64                             last_update_time;                                                                           
        u64                             load_sum;                                                                                   
        u64                             runnable_sum;                                                                               
        u32                             util_sum;                                                                                   
        u32                             period_contrib;                                                                             
        unsigned long                   load_avg;                                                                                   
        unsigned long                   runnable_avg;                                                                               
        unsigned long                   util_avg;                                                                                   
        struct util_est                 util_est;                                                                                   
} ____cacheline_aligned;    

Thanks for fixing it!

@giulianobelinassi giulianobelinassi merged commit 90fabe8 into SUSE:main Apr 3, 2024
2 checks passed
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.

Possible wrong code generation when re-generating struct sched_avg in linux
2 participants