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 -Werror=declaration-after-statement and add flag #3995

Closed
wants to merge 3 commits into from

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Mar 31, 2021

Automate current (and unwritten?) coding guidelines. Let's not waste
considerable time in code reviews discussing problems computers can
catch automatically.

Note this goes against CERT-C recommendations DCL00-C, DCL19-C and many
others but it's the current policy so let's apply and automate it. Can
be changed later.

Signed-off-by: Marc Herbert [email protected]

@cujomalainey
Copy link
Contributor

Thanks for the fixes, i just have one nit, that the fixes and the flag change be two separate patches. Otherwise LGTM

marc-hb added 3 commits April 1, 2021 00:43
Will make git commands (blame, merge, revert, rebase,
cherry-pick,...) much less likely to fail.

Signed-off-by: Marc Herbert <[email protected]>
Do not add the option yet.

Automate current (and unwritten?) coding guidelines. Let's not waste
considerable time in code reviews discussing problems computers can
catch automatically.

Note this goes against CERT-C recommendations DCL00-C, DCL19-C and many
others but it's the current policy so let's apply and automate it. Can
be changed later.

Signed-off-by: Marc Herbert <[email protected]>
Automate current (and unwritten?) coding guidelines. Let's not waste
considerable time in code reviews discussing problems computers can
catch automatically.

Note this goes against CERT-C recommendations DCL00-C, DCL19-C and many
others but it's the current policy so let's apply and automate it. Can
be changed later.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Apr 1, 2021

Thanks for the fixes, i just have one nit, that the fixes and the flag change be 2 separate patches. Otherwise LGTM

3 commits for you sir!

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

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

Thanks more bot info always a win 👍

@lgirdwood
Copy link
Member

@marc-hb can you check CI, this should not break UT (unless it break UT build) ?

@marc-hb
Copy link
Collaborator Author

marc-hb commented Apr 1, 2021

This PR -Wdeclaration-after-statement does break test/cmocka/src/audio/buffer/buffer_new.c and others, see https://sof-ci.01.org/sof-pr-viewer/#/build/PR3995/build6248558

Downgrading to draft for now.

@marc-hb marc-hb marked this pull request as draft April 1, 2021 19:23
@sys-pt1s
Copy link

Can one of the admins verify this patch?

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 20, 2022

@marc-hb Over a year with no activity, keep open?

@marc-hb
Copy link
Collaborator Author

marc-hb commented Apr 20, 2022

The Linux kernel has moved to C99 (even higher actually but not relevant here), we should do the same. Closing
https://lwn.net/Articles/885941/ Moving the kernel to modern C

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.

7 participants