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

cleanup: fix several warnings from a Clang build #2948

Merged

Conversation

federico-sysdig
Copy link
Contributor

What type of PR is this?
/kind cleanup

Any specific area of the project related to this PR?

What this PR does / why we need it:
A Clang build revealed a number of warnings whose fix should increase the quality of the code.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
Copy link

github-actions bot commented Dec 5, 2023

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@federico-sysdig
Copy link
Contributor Author

federico-sysdig commented Dec 5, 2023

The fix is only a cleanup of warnings that introduces no interface or functionality change.

/unhold

Copy link
Contributor

@LucaGuerra LucaGuerra left a comment

Choose a reason for hiding this comment

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

Thanks! 🤩

@poiana
Copy link
Contributor

poiana commented Dec 6, 2023

LGTM label has been added.

Git tree hash: dc570829f3e00c0e4de1159179b498d7bb10e1b2

@poiana
Copy link
Contributor

poiana commented Dec 6, 2023

@LucaGuerra: The provided milestone is not valid for this repository. Milestones in this repository: [0.37.0, 0.38.0, TBD]

Use /milestone clear to clear the milestone.

In response to this:

/milestone 0.14.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@LucaGuerra
Copy link
Contributor

/milestone 0.37.0

@poiana poiana added this to the 0.37.0 milestone Dec 6, 2023

return errstr.c_str();
// const + noexcept: can't use functions that change the object or throw
return msg.c_str();
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes rule load exception errors, right?
cc @jasondellaluce i am not sure we want it.

Copy link
Contributor Author

@federico-sysdig federico-sysdig Dec 6, 2023

Choose a reason for hiding this comment

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

@FedeDP I knew it was a deeper change and I was reluctant to do it, but in the end I decided to go ahead because

  1. the function has the same name of a virtual function and should have the same signature (i.e. with const + noexcept), this is why a warning was raised by the compiler
  2. being noexcept forbids invoking functions that might throw, such as string concatenation
  3. I could not find any place in the code where the function is invoked.

If the new implementation is problematic as it changes the original message, let's talk about it.

Copy link
Contributor

@incertum incertum left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Dec 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: federico-sysdig, incertum, LucaGuerra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [LucaGuerra,incertum]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 44b7352 into falcosecurity:master Dec 6, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants