[libc-commits] [libc] [libc] Remove global printf_core StorageType declarations in float_inf_nan_converter.h (PR #196859)
via libc-commits
libc-commits at lists.llvm.org
Sun May 10 17:51:44 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Nico Weber (nico)
<details>
<summary>Changes</summary>
fixed_converter.h and float_hex_converter.h have local declarations with the same name shadowing it, causing -Wshadow warnings. The using declaration is used in only one function, so just make it local.
---
Full diff: https://github.com/llvm/llvm-project/pull/196859.diff
1 Files Affected:
- (modified) libc/src/stdio/printf_core/float_inf_nan_converter.h (+5-5)
``````````diff
diff --git a/libc/src/stdio/printf_core/float_inf_nan_converter.h b/libc/src/stdio/printf_core/float_inf_nan_converter.h
index 379b7c6d3dcd6..973199d55094b 100644
--- a/libc/src/stdio/printf_core/float_inf_nan_converter.h
+++ b/libc/src/stdio/printf_core/float_inf_nan_converter.h
@@ -22,15 +22,15 @@
namespace LIBC_NAMESPACE_DECL {
namespace printf_core {
+template <WriteMode write_mode>
+LIBC_INLINE int convert_inf_nan(Writer<write_mode> *writer,
+ const FormatSection &to_conv) {
#ifdef LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE
-using StorageType = UInt128;
+ using StorageType = UInt128;
#else
-using StorageType = fputil::FPBits<long double>::StorageType;
+ using StorageType = fputil::FPBits<long double>::StorageType;
#endif // LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE
-template <WriteMode write_mode>
-LIBC_INLINE int convert_inf_nan(Writer<write_mode> *writer,
- const FormatSection &to_conv) {
// All of the letters will be defined relative to variable a, which will be
// the appropriate case based on the case of the conversion.
bool is_negative;
``````````
</details>
https://github.com/llvm/llvm-project/pull/196859
More information about the libc-commits
mailing list