aprantl added inline comments.

================
Comment at: lldb/tools/lldb-vscode/JSONUtils.cpp:353
+      if (debug_info < 1024) {
+        sprintf(debug_info_size, " (%lluKB)", debug_info);
+      } else if (debug_info < 1024*1024) {
----------------
clayborg wrote:
> Use the PRIu64 macro here to make sure this works on all platforms and the 
> units are wrong here, should just be "B" instead of "KB". Also use snprintf 
> for safety:
> ```
> snprintf(debug_info_size, sizeof(debug_info_size), " (%"  PRIu64 "B)", 
> debug_info);
> ```
> PRIu64 is a macro that will expand to a string that will always match a 
> uint64_t. The three strings (" (%", PRIu64, and "B)") will get combined by 
> the compiler into a single format string. 
Could we avoid snprintf altogether by switching to 
http://llvm.org/doxygen/classllvm_1_1raw__string__ostream.html ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83731/new/

https://reviews.llvm.org/D83731



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to