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 errors raised by missing-prototypes #46

Merged
merged 1 commit into from
May 6, 2024

Conversation

HotMercury
Copy link
Collaborator

In the current attempt to run simplefs on the Linux kernel v6.8 environment, encountering the error "no previous prototype for simplefs_mount" indicates a need for additional function declarations.

error: no previous prototype for ‘simplefs_mount’
error: no previous prototype for ‘simplefs_kill_sb’ 

The reason why it worked in previous versions is that the changes related to -Wmissing-declarations and -Wmissing-prototypes were introduced in 6.8-rc1 in commit 0fcb708 .

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve git commit message!

@HotMercury
Copy link
Collaborator Author

Can I fix it like this?
The original program triggered compile-time errors due to missing function prototype declarations for 'simplefs_mount' and 'simplefs_kill_sb'. This commit addresses the issue by adding the necessary function prototype declarations, resolving the compilation errors.

@jserv
Copy link
Collaborator

jserv commented May 3, 2024

Can I fix it like this? The original program triggered compile-time errors due to missing function prototype declarations for 'simplefs_mount' and 'simplefs_kill_sb'. This commit addresses the issue by adding the necessary function prototype declarations, resolving the compilation errors.

No, you must mention the considerations of upstream Linux changes that enforce function prototype checks, along with their impact on this project. Additionally, it is important to be aware of how to avoid missing function prototypes.

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention upstream SHA-1 hash which enforce missing-prototypes checks.

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the git commit message grammatical accuracy.

The recent upstream commit (0fcb708) in the Linux kernel globally
enforces function prototype checks. This means that it's crucial
for each function to have a declaration to validate that both the
caller and the callee expect the same argument types. Failure to
comply with this requirement may result in real bugs due to
mismatched prototypes. Therefore, in this commit, we need to add
function prototypes to the header files or declare functions with
static to ensure compatibility with these changes.
@jserv jserv merged commit 01f582a into sysprog21:master May 6, 2024
2 checks passed
@jserv
Copy link
Collaborator

jserv commented May 6, 2024

Thank @HotMercury for contributing!

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.

2 participants