[PATCH] D74198: [DebugInfo] Add support for DWARF64 into DWARFDebugAddr.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 16:48:48 PST 2020


aprantl added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp:159
+  if (Length) {
+    int LengthFieldWidth = (Format == dwarf::DwarfFormat::DWARF64) ? 16 : 8;
+    OS << format("Address table header: length = 0x%0*" PRIx64
----------------
jhenderson wrote:
> ikudrin wrote:
> > aprantl wrote:
> > > unsigned?
> > Could you explain why `unsinged` is better than `int` here?
> > 
> > Note that according to http://www.cplusplus.com/reference/cstdio/printf/,
> > 
> > > *: The width is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted.
> > 
> > Not "an unsigned integer value".
> I find the following link tends to be more precise and accurate in its wording:
> 
> https://en.cppreference.com/w/cpp/io/c/fprintf
> 
> > (optional) integer value or * that specifies minimum field width. The result is padded with space characters (by default), if required, on the left when right-justified, or on the right if left-justified. In the case when * is used, the width is specified by an additional argument of type `int`. If the value of the argument is negative, it results with the - flag specified and positive field width. (Note: This is the minimum width: The value is never truncated.)
> 
> I don't have a copy of the standard to see whether the type is explicitly mentioned, but that quote definitively says `int`.
Cool, I wasn't aware of that.


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

https://reviews.llvm.org/D74198





More information about the llvm-commits mailing list