[llvm-commits] [compiler-rt] r146526 - /compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc

Kostya Serebryany kcc at google.com
Tue Dec 13 15:34:59 PST 2011


Author: kcc
Date: Tue Dec 13 17:34:59 2011
New Revision: 146526

URL: http://llvm.org/viewvc/llvm-project?rev=146526&view=rev
Log:
[asan] fix some more format warnings in sysinfo/sysinfo.cc

Modified:
    compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc

Modified: compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc?rev=146526&r1=146525&r2=146526&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc (original)
+++ compiler-rt/trunk/lib/asan/sysinfo/sysinfo.cc Tue Dec 13 17:34:59 2011
@@ -322,12 +322,13 @@
 #if defined(__linux__)
     // for now, assume all linuxes have the same format
     if (sscanf(stext_, "%"SCNx64"-%"SCNx64" %4s %"SCNx64" %x:%x %"SCNd64" %n",
-               start ? start : &tmpstart,
-               end ? end : &tmpend,
+               (unsigned long long *)(start ? start : &tmpstart),
+               (unsigned long long *)(end ? end : &tmpend),
                flags_,
-               offset ? offset : &tmpoffset,
+               (unsigned long long *)(offset ? offset : &tmpoffset),
                &major, &minor,
-               inode ? inode : &tmpinode, &filename_offset) != 7) continue;
+               (unsigned long long *)(inode ? inode : &tmpinode),
+               &filename_offset) != 7) continue;
 #elif defined(__CYGWIN__) || defined(__CYGWIN32__)
     // cygwin is like linux, except the third field is the "entry point"
     // rather than the offset (see format_process_maps at
@@ -396,10 +397,14 @@
             uint64 tmp_anon_pages;
 
             sscanf(backing_ptr+1, "F %"SCNx64" %"SCNd64") (A %"SCNx64" %"SCNd64")",
-                   file_mapping ? file_mapping : &tmp_file_mapping,
-                   file_pages ? file_pages : &tmp_file_pages,
-                   anon_mapping ? anon_mapping : &tmp_anon_mapping,
-                   anon_pages ? anon_pages : &tmp_anon_pages);
+                   (unsigned long long *)(file_mapping ?
+                                          file_mapping : &tmp_file_mapping),
+                   (unsigned long long *)(file_pages ?
+                                          file_pages : &tmp_file_pages),
+                   (unsigned long long *)(anon_mapping
+                                          ? anon_mapping : &tmp_anon_mapping),
+                   (unsigned long long *)(anon_pages
+                                          ? anon_pages : &tmp_anon_pages));
             // null terminate the file name (there is a space
             // before the first (.
             backing_ptr[-1] = 0;





More information about the llvm-commits mailing list