[clang] [libclang] Document CXUnsavedFile::Length width and fix test narrowing (PR #228405)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 04:52:18 PDT 2026


================
@@ -118,6 +118,9 @@ struct CXUnsavedFile {
 
   /**
    * The length of the unsaved contents of this buffer.
+   *
+   * Note that this is an \c unsigned \c long, which has a platform-dependent
+   * width. Do not assume it is a 64-bit integer.
----------------
AaronBallman wrote:

We also use `unsigned long` for `CXTUResourceUsageEntry` so should that also be updated? That said, I question the value of the comment. We could apply this same comment to things declared with enumeration types because those have a language-dependent width, technically our use of `unsigned` and `int` are also platform dependent (though I don't know that we actually compile for any 16-bit targets, so that's more theoretical), etc. I'm not opposed to the changes, but I also don't know where we draw the line with leaving similar comments.

https://github.com/llvm/llvm-project/pull/228405


More information about the cfe-commits mailing list