Skip to content

Commit 7edfbf2

Browse files
authored
[lldb][DataFormatter] Fix format specifiers in LibCxxSliceArray summary provider (#85763)
This caused following warnings in an LLDB build: ``` [237/1072] Building CXX object tools/l...lusLanguage.dir/LibCxxSliceArray.cpp.o /Volumes/Data/llvm-project/lldb/source/Plugins/Language/CPlusPlus/LibCxxSliceArray.cpp:38:53: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat] 38 | stream.Printf("stride=%" PRIu64 " size=%" PRIu64, stride, size); | ~~~~~~~~~ ^~~~~~ /Volumes/Data/llvm-project/lldb/source/Plugins/Language/CPlusPlus/LibCxxSliceArray.cpp:38:61: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat] 38 | stream.Printf("stride=%" PRIu64 " size=%" PRIu64, stride, size); | ~~~~~~~~~ ^~~~ 2 warnings generated. ``` This patch simply changes the format specifiers to use the `%zu` for `size_t`s.
1 parent 00ca809 commit 7edfbf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool LibcxxStdSliceArraySummaryProvider(ValueObject &valobj, Stream &stream,
3535
return false;
3636
const size_t stride = ptr_sp->GetValueAsUnsigned(0);
3737

38-
stream.Printf("stride=%" PRIu64 " size=%" PRIu64, stride, size);
38+
stream.Printf("stride=%zu size=%zu", stride, size);
3939

4040
return true;
4141
}

0 commit comments

Comments
 (0)