You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2025/01/09 21:23:11 UTC
(trafficserver-libswoc) branch master updated (1c4e691 -> dbb8e73)
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
from 1c4e691 Add CTest support (#3)
new afba376 Fix some warnings from libswoc when building on FreeBSD 13.1. (#11324)
new 508fa3b libswoc: Remove unused variables from some unit tests. (#11326)
new 6488cfe Remove the need of `-Wno-stringop-overflow` warning suppression (#11357)
new f1c1c9d Remove unused `alloc` parameter in swoc/Vectray functionality (#11475)
new dbb8e73 Fix libswoc compile with clang 20 (#11771)
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
code/include/swoc/DiscreteRange.h | 6 +++---
code/include/swoc/Vectray.h | 6 +++---
unit_tests/CMakeLists.txt | 2 +-
unit_tests/ex_bw_format.cc | 2 --
unit_tests/test_TextView.cc | 4 ----
unit_tests/test_bw_format.cc | 1 -
unit_tests/test_ip.cc | 2 --
unit_tests/test_range.cc | 1 -
8 files changed, 7 insertions(+), 17 deletions(-)
(trafficserver-libswoc) 01/05: Fix some warnings from libswoc when building on FreeBSD 13.1. (#11324)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit afba37662a1677be95e5eb65eac333119dd69ecf
Author: Damian Meden <dm...@apache.org>
AuthorDate: Tue May 7 10:17:26 2024 +0200
Fix some warnings from libswoc when building on FreeBSD 13.1. (#11324)
---
unit_tests/ex_bw_format.cc | 2 --
unit_tests/test_TextView.cc | 3 ---
unit_tests/test_bw_format.cc | 1 -
unit_tests/test_ip.cc | 1 -
unit_tests/test_range.cc | 1 -
5 files changed, 8 deletions(-)
diff --git a/unit_tests/ex_bw_format.cc b/unit_tests/ex_bw_format.cc
index 4291bd6..fa33238 100644
--- a/unit_tests/ex_bw_format.cc
+++ b/unit_tests/ex_bw_format.cc
@@ -463,8 +463,6 @@ C_Format::capture(BufferWriter &, Spec const &spec, std::any const &value) {
// C_Format parsing
bool
C_Format::operator()(std::string_view &literal, Spec &spec) {
- TextView parsed;
-
// clean up any old business from a previous specifier.
if (_prec_p) {
spec._type = Spec::CAPTURE_TYPE;
diff --git a/unit_tests/test_TextView.cc b/unit_tests/test_TextView.cc
index ebeb6c2..20c1797 100644
--- a/unit_tests/test_TextView.cc
+++ b/unit_tests/test_TextView.cc
@@ -22,10 +22,8 @@ TEST_CASE("TextView Constructor", "[libswoc][TextView]") {
static const std::string base = "Evil Dave Rulez!";
unsigned ux = base.size();
TextView tv(base);
- TextView a{"Evil Dave Rulez"};
TextView b{base.data(), base.size()};
TextView c{std::string_view(base)};
- constexpr TextView d{"Grigor!"sv};
TextView e{base.data(), 15};
TextView f(base.data(), 15);
TextView u{base.data(), ux};
@@ -188,7 +186,6 @@ TEST_CASE("TextView Affixes", "[libswoc][TextView]") {
TextView tv3 = "abcdefg:gfedcba";
left = tv3;
right = left.split_suffix_at(";:,");
- TextView pre{tv3}, post{pre.split_suffix(7)};
REQUIRE(right.size() == 7);
REQUIRE(left.size() == 7);
REQUIRE(left == "abcdefg");
diff --git a/unit_tests/test_bw_format.cc b/unit_tests/test_bw_format.cc
index 4f98abc..dc3169a 100644
--- a/unit_tests/test_bw_format.cc
+++ b/unit_tests/test_bw_format.cc
@@ -38,7 +38,6 @@ TEST_CASE("bwprint basics", "[bwprint]") {
swoc::LocalBufferWriter<256> bw;
std::string_view fmt1{"Some text"sv};
swoc::bwf::Format fmt2("left >{0:<9}< right >{0:>9}< center >{0:^9}<");
- std::string_view text{"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
static const swoc::bwf::Format bad_arg_fmt{"{{BAD_ARG_INDEX:{} of {}}}"};
bw.print(fmt1);
diff --git a/unit_tests/test_ip.cc b/unit_tests/test_ip.cc
index b41c1a0..7fc0fd9 100644
--- a/unit_tests/test_ip.cc
+++ b/unit_tests/test_ip.cc
@@ -1250,7 +1250,6 @@ TEST_CASE("IPSpace Edge", "[libswoc][ipspace][edge]") {
auto spot = cspace.find(a1);
static_assert(std::is_same_v<Space::const_iterator, decltype(spot)>);
auto &v1 = *spot;
- auto &p1 = get<1>(v1);
auto const iter = cspace.find(a1);
if (auto &&[r, p] = *iter; !r.empty()) {
diff --git a/unit_tests/test_range.cc b/unit_tests/test_range.cc
index 51e629d..30c9064 100644
--- a/unit_tests/test_range.cc
+++ b/unit_tests/test_range.cc
@@ -13,7 +13,6 @@ using namespace swoc::literals;
using range_t = swoc::DiscreteRange<unsigned>;
TEST_CASE("Discrete Range", "[libswoc][range]") {
- range_t none; // empty range.
range_t single{56};
range_t r1{56, 100};
range_t r2{101, 200};
(trafficserver-libswoc) 05/05: Fix libswoc compile with clang 20 (#11771)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit dbb8e73e565e6bb775ad04d60d8fe1b67a1c4479
Author: Mo Chen <mo...@apache.org>
AuthorDate: Tue Sep 17 10:00:38 2024 -0500
Fix libswoc compile with clang 20 (#11771)
- Fix incorrect method name has_intersection (should be has_intersection_with).
- template keyword on a method call causes a warning if template arguments are not supplied.
---
code/include/swoc/DiscreteRange.h | 6 +++---
code/include/swoc/Vectray.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/code/include/swoc/DiscreteRange.h b/code/include/swoc/DiscreteRange.h
index cfd8dba..7becebf 100644
--- a/code/include/swoc/DiscreteRange.h
+++ b/code/include/swoc/DiscreteRange.h
@@ -464,7 +464,7 @@ template <typename T>
auto
DiscreteRange<T>::relationship(self_type const &that) const -> Relation {
Relation retval = Relation::NONE;
- if (this->has_intersection(that)) {
+ if (this->has_intersection_with(that)) {
if (*this == that)
retval = Relation::EQUAL;
else if (this->is_subset_of(that))
@@ -568,7 +568,7 @@ DiscreteRange<T>::max() const {
template <typename T>
bool
DiscreteRange<T>::has_union(DiscreteRange::self_type const &that) const {
- return this->has_intersection(that) || this->is_adjacent_to(that);
+ return this->has_intersection_with(that) || this->is_adjacent_to(that);
}
template <typename T>
@@ -644,7 +644,7 @@ operator!=(DiscreteRange<T> const &lhs, DiscreteRange<T> const &rhs) {
template <typename T>
bool
operator^(DiscreteRange<T> const &lhs, DiscreteRange<T> const &rhs) {
- return lhs.has_intersection(rhs);
+ return lhs.has_intersection_with(rhs);
}
/** Containment ordering.
diff --git a/code/include/swoc/Vectray.h b/code/include/swoc/Vectray.h
index eb53705..5ebb0bd 100644
--- a/code/include/swoc/Vectray.h
+++ b/code/include/swoc/Vectray.h
@@ -248,7 +248,7 @@ template <typename T, size_t N, class A> template <size_t M> Vectray<T, N, A>::V
if (span.size() > N) {
} else {
for (auto &&item : span) {
- this->template emplace_back(std::move(item));
+ this->template emplace_back<T, N, A>(std::move(item));
}
}
}
@@ -287,7 +287,7 @@ Vectray<T, N, A>::operator[](size_type idx) {
template <typename T, size_t N, typename A>
T const &
Vectray<T, N, A>::operator[](size_type idx) const {
- return this->items[idx];
+ return this->items()[idx];
}
template <typename T, size_t N, typename A>
(trafficserver-libswoc) 03/05: Remove the need of `-Wno-stringop-overflow` warning suppression (#11357)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit 6488cfe6557161ef36187ddc98a8de5f2a531da1
Author: Pavel Vazharov <pa...@x3me.net>
AuthorDate: Thu May 16 18:21:52 2024 +0300
Remove the need of `-Wno-stringop-overflow` warning suppression (#11357)
* Remove the need of -Wno-stringop-overflow warning suppression
The problem was that GCC complained for possibly incorrect usage of
strncat due to the last argument being equal to the source string length.
The last argument of strncat is supposed to be the remaining free space in
the destination buffer.
Replaced the usage of strncat with the ATS function ink_strlcat.
* Fix bogus warning for strncat usage in s3_auth plugin given by GCC 11
The change is to use TSstrlcat instead of strncat.
It seems to me the GCC analyzer is wrong in this case and it issues the
warning because of such usage:
str_concat(&left[loff], (left_size - loff), "/", 1);
and the str_concat internally does
std::min(dst_len, src_len) for the strncat size argument.
So GCC sees the possibility that the last argument of strncat can be
equal to the legnth of the source argument and issues the warning.
---
unit_tests/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt
index a26ab69..0a2d4de 100644
--- a/unit_tests/CMakeLists.txt
+++ b/unit_tests/CMakeLists.txt
@@ -33,7 +33,7 @@ add_executable(test_libswoc
target_link_libraries(test_libswoc PUBLIC libswoc)
set_target_properties(test_libswoc PROPERTIES CLANG_FORMAT_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
if (CMAKE_COMPILER_IS_GNUCXX)
- target_compile_options(test_libswoc PRIVATE -Wall -Wextra -Werror -Wno-unused-parameter -Wno-format-truncation -Wno-stringop-overflow -Wno-invalid-offsetof)
+ target_compile_options(test_libswoc PRIVATE -Wall -Wextra -Werror -Wno-unused-parameter -Wno-format-truncation -Wno-invalid-offsetof)
# stop the compiler from complaining about unused variable in structured binding
if (GCC_VERSION VERSION_LESS 8.0)
target_compile_options(test_libswoc PRIVATE -Wno-unused-variable)
(trafficserver-libswoc) 02/05: libswoc: Remove unused variables from some unit tests. (#11326)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit 508fa3b2c5d71e25702c6f93d8de4a714114c6fb
Author: Damian Meden <dm...@apache.org>
AuthorDate: Thu May 9 09:31:21 2024 +0200
libswoc: Remove unused variables from some unit tests. (#11326)
---
unit_tests/test_TextView.cc | 1 -
unit_tests/test_ip.cc | 1 -
2 files changed, 2 deletions(-)
diff --git a/unit_tests/test_TextView.cc b/unit_tests/test_TextView.cc
index 20c1797..1499594 100644
--- a/unit_tests/test_TextView.cc
+++ b/unit_tests/test_TextView.cc
@@ -400,7 +400,6 @@ TEST_CASE("TextView Affixes", "[libswoc][TextView]") {
// Checking that constexpr works for this constructor as long as npos isn't used.
static constexpr TextView ctv2{"http://delain.nl/albums/Interlude.html", 38};
- TextView ctv4{"http://delain.nl/albums/Interlude.html", 38};
// This doesn't compile because it causes strlen to be called which isn't constexpr compatible.
// static constexpr TextView ctv3 {"http://delain.nl/albums/Interlude.html", TextView::npos};
// This works because it's not constexpr.
diff --git a/unit_tests/test_ip.cc b/unit_tests/test_ip.cc
index 7fc0fd9..35e25b1 100644
--- a/unit_tests/test_ip.cc
+++ b/unit_tests/test_ip.cc
@@ -1249,7 +1249,6 @@ TEST_CASE("IPSpace Edge", "[libswoc][ipspace][edge]") {
auto spot = cspace.find(a1);
static_assert(std::is_same_v<Space::const_iterator, decltype(spot)>);
- auto &v1 = *spot;
auto const iter = cspace.find(a1);
if (auto &&[r, p] = *iter; !r.empty()) {
(trafficserver-libswoc) 04/05: Remove unused `alloc` parameter in swoc/Vectray functionality (#11475)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit f1c1c9d5c09c33eb69977d13636871d0132091a9
Author: Pavel Vazharov <pa...@x3me.net>
AuthorDate: Tue Jun 25 18:19:07 2024 +0300
Remove unused `alloc` parameter in swoc/Vectray functionality (#11475)
---
code/include/swoc/Vectray.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/include/swoc/Vectray.h b/code/include/swoc/Vectray.h
index e2e6485..eb53705 100644
--- a/code/include/swoc/Vectray.h
+++ b/code/include/swoc/Vectray.h
@@ -232,7 +232,7 @@ protected:
template <typename T, size_t N, typename A> Vectray<T, N, A>::Vectray() {}
-template <typename T, size_t N, class A> Vectray<T, N, A>::Vectray(Vectray::size_type n, allocator_type const &alloc) : Vectray() {
+template <typename T, size_t N, class A> Vectray<T, N, A>::Vectray(Vectray::size_type n, allocator_type const &) : Vectray() {
this->reserve(n);
while (n-- > 0) {
this->emplace_back();