Skip to content

Commit 03e4070

Browse files
committed
[lldb] Silence warning when building with Clang ToT
This fixes: ``` [6331/7452] Building CXX object tools\lldb\source\Plugins\Language\CPlusPlus\CMakeFiles\lldbPluginCPlusPlusLanguage.dir\LibCxx.cpp.obj C:\git\llvm-project\lldb\source\Plugins\Language\CPlusPlus\LibCxx.cpp(1108,38): warning: format specifies type 'long' but the argument has type 'std::time_t' (aka 'long long') [-Wformat] 1108 | stream.Printf("timestamp=%ld s", seconds); | ~~~ ^~~~~~~ | %lld C:\git\llvm-project\lldb\source\Plugins\Language\CPlusPlus\LibCxx.cpp(1116,63): warning: format specifies type 'long' but the argument has type 'std::time_t' (aka 'long long') [-Wformat] 1116 | stream.Printf("date/time=%s timestamp=%ld s", str.data(), seconds); | ~~~ ^~~~~~~ | %lld 2 warnings generated. ```
1 parent f42f551 commit 03e4070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,15 +1105,15 @@ bool lldb_private::formatters::LibcxxChronoSysSecondsSummaryProvider(
11051105

11061106
const std::time_t seconds = ptr_sp->GetValueAsSigned(0);
11071107
if (seconds < chrono_timestamp_min || seconds > chrono_timestamp_max)
1108-
stream.Printf("timestamp=%ld s", seconds);
1108+
stream.Printf("timestamp=%lld s", seconds);
11091109
else {
11101110
std::array<char, 128> str;
11111111
std::size_t size =
11121112
std::strftime(str.data(), str.size(), "%FT%H:%M:%SZ", gmtime(&seconds));
11131113
if (size == 0)
11141114
return false;
11151115

1116-
stream.Printf("date/time=%s timestamp=%ld s", str.data(), seconds);
1116+
stream.Printf("date/time=%s timestamp=%lld s", str.data(), seconds);
11171117
}
11181118

11191119
return true;

0 commit comments

Comments
 (0)