delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/04/24/12:10:32

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=E+7/eSaCqCbr0I/TN3WJ3dLYY//eLQo3iubFJXHM3eH
3TLhuWvyyVb/RdRwfb4RAe51r47oBJwE6j2wipOuXTIOzIpKmZjg56KhUEe+PHQT
CxUwlkZDFD9QnMwFMtVfDf+sAu2O25FES22HbV5KngnhledmiKtp6D8C91BGULl0
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=8QPiHv5pQ7yA47UnC3u7kG90mcs=; b=PtL9A8KdbGi1DsIol
35AoxKbUY1qtg59lNUr+fpo2zvIWTUK8weM1UmJgCCWJAGLYVdGUxtv2hQqIolaq
s2ZqrHCOzBH/ZdQLH7glSnhu90usY68ukA/DHZYwy3kTGP+bmqFLkpr4YjdgpBDF
nAajzufOMvV1dgW8vlbcEMIwIc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1
Message-ID: <517803D9.3060504@t-online.de>
Date: Wed, 24 Apr 2013 18:10:01 +0200
From: Christian Franke <Christian DOT Franke AT t-online DOT de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Porting to 64 bit Cygwin (was Re: Difference in 32/64-bit curl.)
References: <51766C22 DOT 10702 AT bahnhof DOT se> <51770372 DOT 4070408 AT t-online DOT de> <20130424125930 DOT GQ26397 AT calimero DOT vinschen DOT de> <20130424134749 DOT GR26397 AT calimero DOT vinschen DOT de>
In-Reply-To: <20130424134749.GR26397@calimero.vinschen.de>

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]).



> ...
> - 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.


Christian


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019