Skip to content

Fix -Werror=declaration-after-statement and add flag - #3995

Closed
marc-hb wants to merge 3 commits into
thesofproject:mainfrom
marc-hb:C90-decl
Closed

Fix -Werror=declaration-after-statement and add flag#3995
marc-hb wants to merge 3 commits into
thesofproject:mainfrom
marc-hb:C90-decl

Conversation

@marc-hb

Copy link
Copy Markdown
Collaborator

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 marc.herbert@intel.com

@cujomalainey

Copy link
Copy Markdown
Contributor

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

Will make git commands (blame, merge, revert, rebase,
cherry-pick,...) much less likely to fail.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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 <marc.herbert@intel.com>
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 <marc.herbert@intel.com>
@marc-hb

Copy link
Copy Markdown
CollaboratorAuthor

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!

@cujomalaineycujomalainey left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

@marc-hb

marc-hb commented Apr 1, 2021

Copy link
Copy Markdown
CollaboratorAuthor

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
Copy Markdown

Can one of the admins verify this patch?

@kv2019i

Copy link
Copy Markdown
Collaborator

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

@marc-hb

Copy link
Copy Markdown
CollaboratorAuthor

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 freeto 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

@marc-hb@cujomalainey@lgirdwood@sys-pt1s@kv2019i@dbaluta@paulstelian97