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

Portability fixes and compiler warning fixes #9

Closed
wants to merge 5 commits into from

Conversation

jsquyres
Copy link
Contributor

@jsquyres jsquyres commented May 9, 2019

  • Remove some old kruft and what looks like an old debugging message from CMakeLists.txt
  • Only use -Werror=bool-compare if the compiler actually supports it
  • Mark a bunch of C++ method parameters as FOLLY_MAYBE_UNUSED to avoid compiler warnings
  • Fix a bunch of signed/unsigned comparisons in tests to avoid compiler warnings

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 9, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@lnicco has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@mjoras
Copy link
Contributor

mjoras commented May 10, 2019

Thank you for contributing!

Can you remove the changes for fixing unsigned/signed comparisons? As you noted it is in test code, and the comparisons are actually not unsafe. I'm additionally not a fan of the U UL and ULL suffixes as most of mvfst uses fixed length integral types, for which there are not convenient C++ suffixes. Can you instead disable the warning for tests?

@jsquyres
Copy link
Contributor Author

Done!

Took a little bit because I had to learn a bit about cmake.

I also added a commit about some _Nonnull qualifiers; please have a look.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@mjoras has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

quic/state/QuicStreamManager.h Outdated Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@mjoras has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@jsquyres jsquyres force-pushed the pr/fix-compiler-warnings branch 3 times, most recently from cc04e26 to 5f63e30 Compare June 21, 2019 22:24
Remove a commented-out line, and remove what looks like a leftover
debug message.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
Only add -Werror=bool-compare if the compiler actually supports it.
Some compilers do not (e.g., MacOS Mojave 10.14 Apple LLVM version
10.0.1 (clang-1001.0.46.4)).

Signed-off-by: Jeff Squyres <jeff@squyres.com>
Suppress compiler warnings by marking a sometimes-unused function
parameter.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
Quiet compiler warnings by adding a _Nonnull qualifier to the return
of QuicStreamManager::getStream().

Signed-off-by: Jeff Squyres <jeff@squyres.com>
Disable some compiler warnings that originate from -Wextra in
_QUIC_BASE_COMPILE_OPTIONS.  E.g., without -Wno-sign-compare, we get
oodles of warnings in the tests about comparing unsigned variables
with integer constants.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
@jsquyres
Copy link
Contributor Author

@mjoras Unless you have another suggestion, I don't see a way to avoid the FOLLY_MAYBE_UNUSED in that one case. I've rebased on master/HEAD; please have a look. Thanks.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@mjoras has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mjoras merged this pull request in b2f4480.

@jsquyres jsquyres deleted the pr/fix-compiler-warnings branch June 26, 2019 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants