zturner added inline comments.

================
Comment at: lldb/trunk/source/Host/common/FileSpec.cpp:108
@@ +107,3 @@
+        if (stat_result == 0)
+            *stats_ptr = *reinterpret_cast<struct stat *>(&file_stats);
+        return stat_result == 0;
----------------
cameron314 wrote:
> zturner wrote:
> > I don't think this line is correct.  The source and destination struct 
> > types do not always have the same layout, so I think you may need to copy 
> > the values out one by one.
> It's probably better if I copy the fields for the sake of forwards 
> compatibility, but I checked the definitions of these structures and they 
> should be 100% compatible. I'll make the change, though, the 
> `reinterpret_cast` is really ugly.
Apparently the CRT uses a reinterpret_cast too.  As long as you put:

    static_assert(sizeof(struct stat) == sizeof(struct _stat64i32));

then the cast is probably fine.


Repository:
  rL LLVM

http://reviews.llvm.org/D17107



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

Reply via email to