mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[wpiutil] Suppress fmtlib clang-tidy warning in C++20 consteval contexts (#4364)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
From 6742d9385ef8ce677549186cde50c6173d503fac Mon Sep 17 00:00:00 2001
|
From 752710e3aa2cb8ba601a501c98591fd06ab95cc4 Mon Sep 17 00:00:00 2001
|
||||||
From: Tyler Veness <calcmogul@gmail.com>
|
From: Tyler Veness <calcmogul@gmail.com>
|
||||||
Date: Wed, 18 May 2022 10:21:49 -0700
|
Date: Wed, 18 May 2022 10:21:49 -0700
|
||||||
Subject: [PATCH] Don't throw on write failure
|
Subject: [PATCH 1/2] Don't throw on write failure
|
||||||
|
|
||||||
---
|
---
|
||||||
include/fmt/format-inl.h | 4 +---
|
include/fmt/format-inl.h | 4 +---
|
||||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Don't throw on write failure
|
|||||||
3 files changed, 3 insertions(+), 7 deletions(-)
|
3 files changed, 3 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h
|
diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h
|
||||||
index f44df01c..d8906c9a 100644
|
index f44df01..d8906c9 100644
|
||||||
--- a/include/fmt/format-inl.h
|
--- a/include/fmt/format-inl.h
|
||||||
+++ b/include/fmt/format-inl.h
|
+++ b/include/fmt/format-inl.h
|
||||||
@@ -79,9 +79,7 @@ FMT_FUNC void report_error(format_func func, int error_code,
|
@@ -79,9 +79,7 @@ FMT_FUNC void report_error(format_func func, int error_code,
|
||||||
@@ -25,7 +25,7 @@ index f44df01c..d8906c9a 100644
|
|||||||
|
|
||||||
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
|
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
|
||||||
diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h
|
diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h
|
||||||
index 2865b76e..5a062e80 100644
|
index 2865b76..5a062e8 100644
|
||||||
--- a/include/fmt/xchar.h
|
--- a/include/fmt/xchar.h
|
||||||
+++ b/include/fmt/xchar.h
|
+++ b/include/fmt/xchar.h
|
||||||
@@ -203,8 +203,7 @@ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
|
@@ -203,8 +203,7 @@ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
|
||||||
@@ -39,7 +39,7 @@ index 2865b76e..5a062e80 100644
|
|||||||
|
|
||||||
inline void vprint(wstring_view fmt, wformat_args args) {
|
inline void vprint(wstring_view fmt, wformat_args args) {
|
||||||
diff --git a/src/os.cc b/src/os.cc
|
diff --git a/src/os.cc b/src/os.cc
|
||||||
index f388ead0..2c499512 100644
|
index f388ead..2c49951 100644
|
||||||
--- a/src/os.cc
|
--- a/src/os.cc
|
||||||
+++ b/src/os.cc
|
+++ b/src/os.cc
|
||||||
@@ -277,8 +277,7 @@ std::size_t file::read(void* buffer, std::size_t count) {
|
@@ -277,8 +277,7 @@ std::size_t file::read(void* buffer, std::size_t count) {
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
From 7d5472fbc65e876fc7c30974cdc1b5e87b99dc0f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tyler Veness <calcmogul@gmail.com>
|
||||||
|
Date: Thu, 18 Aug 2022 20:22:11 -0700
|
||||||
|
Subject: [PATCH 2/2] Suppress clang-tidy warning false positive
|
||||||
|
|
||||||
|
---
|
||||||
|
include/fmt/core.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/include/fmt/core.h b/include/fmt/core.h
|
||||||
|
index 0e7843b..d60d2f6 100644
|
||||||
|
--- a/include/fmt/core.h
|
||||||
|
+++ b/include/fmt/core.h
|
||||||
|
@@ -2921,7 +2921,7 @@ class format_string_checker {
|
||||||
|
basic_string_view<Char> format_str, ErrorHandler eh)
|
||||||
|
: context_(format_str, num_args, types_, eh),
|
||||||
|
parse_funcs_{&parse_format_specs<Args, parse_context_type>...},
|
||||||
|
- types_{type_constant<Args, char>::value...} {}
|
||||||
|
+ types_{type_constant<Args, char>::value...} {} // NOLINT(clang-analyzer-optin.cplusplus.UninitializedObject)
|
||||||
|
|
||||||
|
FMT_CONSTEXPR void on_text(const Char*, const Char*) {}
|
||||||
|
|
||||||
@@ -17,7 +17,15 @@ def main():
|
|||||||
|
|
||||||
# Apply patches to original git repo
|
# Apply patches to original git repo
|
||||||
prefix = os.path.join(root, "upstream_utils/fmt_patches")
|
prefix = os.path.join(root, "upstream_utils/fmt_patches")
|
||||||
am_patches(repo, [os.path.join(prefix, "0001-Don-t-throw-on-write-failure.patch")])
|
am_patches(
|
||||||
|
repo,
|
||||||
|
[
|
||||||
|
os.path.join(prefix, "0001-Don-t-throw-on-write-failure.patch"),
|
||||||
|
os.path.join(
|
||||||
|
prefix, "0002-Suppress-clang-tidy-warning-false-positive.patch"
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
# Delete old install
|
# Delete old install
|
||||||
for d in [
|
for d in [
|
||||||
|
|||||||
@@ -2921,7 +2921,7 @@ class format_string_checker {
|
|||||||
basic_string_view<Char> format_str, ErrorHandler eh)
|
basic_string_view<Char> format_str, ErrorHandler eh)
|
||||||
: context_(format_str, num_args, types_, eh),
|
: context_(format_str, num_args, types_, eh),
|
||||||
parse_funcs_{&parse_format_specs<Args, parse_context_type>...},
|
parse_funcs_{&parse_format_specs<Args, parse_context_type>...},
|
||||||
types_{type_constant<Args, char>::value...} {}
|
types_{type_constant<Args, char>::value...} {} // NOLINT(clang-analyzer-optin.cplusplus.UninitializedObject)
|
||||||
|
|
||||||
FMT_CONSTEXPR void on_text(const Char*, const Char*) {}
|
FMT_CONSTEXPR void on_text(const Char*, const Char*) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user