-
Notifications
You must be signed in to change notification settings - Fork 851
Fix Rocky Linux 8 arm64 GCC Compiler Warnings #8850
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
Merged
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_rocky_8_arm64_compiler_warnings
May 19, 2022
Merged
Fix Rocky Linux 8 arm64 GCC Compiler Warnings #8850
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_rocky_8_arm64_compiler_warnings
May 19, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bneradt
commented
May 14, 2022
d86e8a5 to
213ac02
Compare
randall
previously approved these changes
May 16, 2022
ywkaras
requested changes
May 17, 2022
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of reinterpret_cast may result in a wild this pointer, and it bypasses some compile-time checking.
This patch addresses the compiler warnings raised by the GCC 11.2.1
compiler on Rocky Linux 8 arm64:
-Werror=shift-negative-value in I_Continuation.h:
In file included from src/ts_asf_master_test_build/iocore/eventsystem/I_Action.h:29,
from src/ts_asf_master_test_build/iocore/eventsystem/I_EventSystem.h:32,
from src/ts_asf_master_test_build/iocore/eventsystem/I_VConnection.h:29,
from QUICStreamVCAdapter.cc:24:
src/ts_asf_master_test_build/iocore/eventsystem/I_Continuation.h: In instantiation of _constexpr int (Continuation::* continuation_handler_void_ptr(int (C::*)(int, T*)))(int, void*) [with C = QUICStreamVCAdapter; T = void; ContinuationHandler = int (Continuation:
:*)(int, void*)]_:
QUICStreamVCAdapter.cc:29:3: required from here
src/ts_asf_master_test_build/iocore/eventsystem/I_Continuation.h:74:10: error: left shift of negative value [-Werror=shift-negative-value]
74 | return static_cast<ContinuationHandler>(fp2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Werror=sign-compare in fastlz.cc:
This fixes a gcc 11.2.1 compiler warning in Rocky Linux 8 arm64:
fastlz.cc: In function _void flz_copy64(uint8_t*, const uint8_t*, uint32_t)_:
fastlz.cc:209:17: error: comparison of integer expressions of different signedness: _int_ and _uint32_t_ {aka _unsigned int_} [-Werror=sign-compare]
209 | for (c = 0; c < count * 8; ++c) {
| ~~^~~~~~~~~~~
-Werror=maybe-uninitialized in header_rewrite:
header_rewrite/conditions.cc: In static member function _static void ConditionInbound::append_value(std::string&, const Resources&, NetworkSessionQualifiers)_:
header_rewrite/conditions.cc:1131:56: error: _tags_ may be used uninitialized [-Werror=maybe-uninitialized]
1131 | TSHttpTxnClientProtocolStackGet(res.txnp, tags.size(), tags.data(), &count);
| ~~~~~~~~~^~
In file included from header_rewrite/conditions.cc:29:
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/array:176:7: note: by argument 1 of type _const std::array<const char*, 8>*_ to _constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = const char*; long unsigned int _Nm = 8]_ declared here
176 | size() const noexcept { return _Nm; }
| ^~~~
header_rewrite/conditions.cc:1128:33: note: _tags_ declared here
1128 | std::array<char const *, 8> tags;
| ^~~~
-Werror=type-limits in traffic_dump:
experimental/traffic_dump/json_utils.cc: In function _int {anonymous}::esc_json_out(const char*, int64_t, std::ostream&)_:
experimental/traffic_dump/json_utils.cc:117:18: error: comparison is always true due to limited range of data type [-Werror=type-limits]
117 | if ('\x00' <= c && c <= '\x1f') {
| ~~~~~~~^~~~
213ac02 to
31f331b
Compare
ywkaras
approved these changes
May 18, 2022
randall
approved these changes
May 19, 2022
zwoop
pushed a commit
that referenced
this pull request
May 25, 2022
This patch addresses the compiler warnings raised by the GCC 11.2.1
compiler on Rocky Linux 8 arm64:
-Werror=shift-negative-value in I_Continuation.h:
In file included from src/ts_asf_master_test_build/iocore/eventsystem/I_Action.h:29,
from src/ts_asf_master_test_build/iocore/eventsystem/I_EventSystem.h:32,
from src/ts_asf_master_test_build/iocore/eventsystem/I_VConnection.h:29,
from QUICStreamVCAdapter.cc:24:
src/ts_asf_master_test_build/iocore/eventsystem/I_Continuation.h: In instantiation of _constexpr int (Continuation::* continuation_handler_void_ptr(int (C::*)(int, T*)))(int, void*) [with C = QUICStreamVCAdapter; T = void; ContinuationHandler = int (Continuation:
:*)(int, void*)]_:
QUICStreamVCAdapter.cc:29:3: required from here
src/ts_asf_master_test_build/iocore/eventsystem/I_Continuation.h:74:10: error: left shift of negative value [-Werror=shift-negative-value]
74 | return static_cast<ContinuationHandler>(fp2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Werror=sign-compare in fastlz.cc:
This fixes a gcc 11.2.1 compiler warning in Rocky Linux 8 arm64:
fastlz.cc: In function _void flz_copy64(uint8_t*, const uint8_t*, uint32_t)_:
fastlz.cc:209:17: error: comparison of integer expressions of different signedness: _int_ and _uint32_t_ {aka _unsigned int_} [-Werror=sign-compare]
209 | for (c = 0; c < count * 8; ++c) {
| ~~^~~~~~~~~~~
-Werror=maybe-uninitialized in header_rewrite:
header_rewrite/conditions.cc: In static member function _static void ConditionInbound::append_value(std::string&, const Resources&, NetworkSessionQualifiers)_:
header_rewrite/conditions.cc:1131:56: error: _tags_ may be used uninitialized [-Werror=maybe-uninitialized]
1131 | TSHttpTxnClientProtocolStackGet(res.txnp, tags.size(), tags.data(), &count);
| ~~~~~~~~~^~
In file included from header_rewrite/conditions.cc:29:
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/array:176:7: note: by argument 1 of type _const std::array<const char*, 8>*_ to _constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = const char*; long unsigned int _Nm = 8]_ declared here
176 | size() const noexcept { return _Nm; }
| ^~~~
header_rewrite/conditions.cc:1128:33: note: _tags_ declared here
1128 | std::array<char const *, 8> tags;
| ^~~~
-Werror=type-limits in traffic_dump:
experimental/traffic_dump/json_utils.cc: In function _int {anonymous}::esc_json_out(const char*, int64_t, std::ostream&)_:
experimental/traffic_dump/json_utils.cc:117:18: error: comparison is always true due to limited range of data type [-Werror=type-limits]
117 | if ('\x00' <= c && c <= '\x1f') {
| ~~~~~~~^~~~
(cherry picked from commit ef917f9)
Contributor
|
Cherry-picked to v9.2.x |
masaori335
pushed a commit
to masaori335/trafficserver
that referenced
this pull request
Feb 21, 2023
* asf/9.2.x: Updated ChangeLog Restore down nameservers after they come back online (apache#8847) Fix Rocky Linux 8 arm64 GCC Compiler Warnings (apache#8850) Fix `COMPRESSION_ERROR` on valid HPACK input (apache#8817) remap_stats: convert to using TSHttpTxnPristineUrlGet and TSHttpTxnClientReqGet for hostname, remove pre remap continuation (apache#8362) Re-introduce import to get man_pages list available for sphinx. Closes apache#8858 (apache#8859) Add missing configuration files man pages (apache#8861)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch addresses the compiler warnings raised by the GCC 11.2.1
compiler on Rocky Linux 8 arm64:
-Werror=shift-negative-value in I_Continuation.h:
-Werror=sign-compare in fastlz.cc:
-Werror=maybe-uninitialized in header_rewrite:
-Werror=type-limits in traffic_dump: