Porting to 64 bit Cygwin (was Re: Difference in 32/64-bit curl.)
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Apr 24 18:12:00 GMT 2013
On Apr 24 18:10, Christian Franke wrote:
> Corinna Vinschen wrote:
> >For clearness I decided to add a quick lecture. Hope that's ok.
>
> Makes much sense. I would suggest two additions:
>
> >...
> >- DON'T mix up int and long in printf/scanf. This:
> >
> > int i; long l;
> > printf ("%d %ld\n", l, i);
> >
> > may not print what you think it should.
>
> - DON'T forget to enable -Wformat gcc warnings, try also -Wformat=2.
>
> (-Wformat is included in -Wall, -Wformat=2 is neither included in
> -Wall nor in -W[extra]).
Thanks, I added something along these lines to the new FAQ entry. See
http://cygwin.com/faq-nochunks.html#faq.programming.64bitporting
> >- DON'T use C base types together with Win32 functions. Keep in mind
> > that DWORD, LONG, ULONG are *not* the same as long and unsigned long.
> > Try to use only Win32 datatypes in conjunction with Win32 API function
> > calls to avoid type problems.
>
> - DON'T forget to add casts if such Win32 API types are used with
> printf(). This:
>
> printf("Win32 Error=%lu\n", GetLastError());
>
> worked for all i686 and Windows x86_64, but fails now on Cygwin x86_64.
I skipped that because the FAQ entry is not exactly what I wrote in my
mail. Do you still think this is necessary?
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list