This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: src/winsup/utils ChangeLog.64bit cygcheck.cc l ...


On 02/06/2013 10:03 AM, corinna@cygwin.com wrote:
> CVSROOT:	/cvs/src
> Module name:	src
> Branch: 	cygwin-64bit-branch
> Changes by:	corinna@sourceware.org	2013-02-06 17:03:49
> 
> Modified files:
> 	winsup/utils   : ChangeLog.64bit cygcheck.cc ldd.cc locale.cc 
> 	                 mkgroup.c mkpasswd.c mount.cc passwd.c path.cc 
> 	                 ssp.c strace.cc tzset.c 
> 
> Log message:
> 	Throughout, fix type problems on 32 and 64 bit.  Except:
> 	* ssp.c: Disable entire functionality on x86_64 for now.

Out of curiosity, I looked at some of these changes.

> http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/utils/ldd.cc.diff?cvsroot=src&only_with_tag=cygwin-64bit-branch&r1=1.14&r2=1.14.2.1

 #include <string.h>
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
 #include <wchar.h>
 #include <locale.h>
 #include <sys/cygwin.h>
@@ -162,7 +164,8 @@
   wchar_t *buf = get_module_filename (GetCurrentProcess (), NULL);
   if (!buf)
     {
-      printf ("ldd: GetModuleFileName returned an error %lu\n",
GetLastError ());
+      printf ("ldd: GetModuleFileName returned an error %" PRIu32 "\n",
+	      (unsigned int) GetLastError ());

PRIu32 is for uint32_t, not unsigned int; and on platforms where
uint32_t is unsigned long, you've ended up causing a compiler warning.
If you are going to cast GetLastError(), then just use %u; no need to
drag in <inttypes.h>.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]