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

disable warnings in third-party code #281

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

cwpearson
Copy link
Contributor

This is third-party code, so modify the compiler flags instead of the code itself.

Signed-off-by: Carl Pearson <cwpears@sandia.gov>
@cwpearson cwpearson force-pushed the fix/perfetto-redundant-move branch from 0743c3c to 82870a3 Compare January 16, 2025 19:45
@cwpearson
Copy link
Contributor Author

-Wno-error=redundant-move was introduced in GCC 9.1 and Clang 3.7

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

If anything we should disable all warnings.
On my cell now but I am sure you can find examples of us doing that, possibly for gtest in core?

@dalg24
Copy link
Member

dalg24 commented Jan 17, 2025

If anything we should disable all warnings.
On my cell now but I am sure you can find examples of us doing that, possibly for gtest in core?

We do it in perf_test for google benchmark. Sorry can't get a reference but I am sure you'll find it

Signed-off-by: Carl Pearson <cwpears@sandia.gov>
@cwpearson cwpearson force-pushed the fix/perfetto-redundant-move branch from dd65e12 to dc32e06 Compare January 17, 2025 16:18
@cwpearson
Copy link
Contributor Author

Cool, TIL about -w / /w.

Changed perfetto.cc to be compiled into its own static library so we still get warnings from our connector code.

@cwpearson cwpearson changed the title exclude redundant-move from error in third-party code disable warnings in third-party code Jan 17, 2025
@cwpearson cwpearson requested a review from dalg24 January 17, 2025 16:27
Comment on lines +2 to +3
add_library(perfetto_static STATIC perfetto/perfetto.cc)
set_target_properties(perfetto_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we built the library explicitly as static with fpic instead of shared?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured it was less opportunity for something to go wrong during the build. I don't have a strong opinion.

@masterleinad
Copy link
Contributor

Changed perfetto.cc to be compiled into its own static library so we still get warnings from our connector code.

Can you elaborate on that?

@cwpearson
Copy link
Contributor Author

cwpearson commented Jan 21, 2025

Used to be that our connector code (libperfetto-connector.cc) and the third-party perfetto.cc were compiled into the same target, so whatever options were applied to one would be applied to both. I split them up so we could ignore warnings from perfetto.cc and otherwise leave our code compiling the way it used to be.

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Fine with me.

@cwpearson
Copy link
Contributor Author

I don't have the merge power, someone else will have to hit the button

@masterleinad
Copy link
Contributor

I don't have the merge power, someone else will have to hit the button

Probably only @dalg24 and @crtrott.

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.

3 participants