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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=tx5ol3kguQOO1L+7 0V4PDAkgCvNoYe3/6h8OVHEXm0jaKwm4mlq8TMmqJiMXBk/464Zd6zWulhLP3kPF BEZNGXVnWP0VTMzQwMs/Xr7Xo4C6kNp1XzEpCO9fAHGoKV1WiKE4t4AbxvVS7GkD 3TjlPeT1Dw9M0MwRrL9M0l+Q9uE= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=7ieLi1Vfo67TlPYOrNyKkA RjHJc=; b=czFCtnoIiBIQV9+YfoPZpYlc5nFgWA8q6auTLsGcXNJs68gxTIbMWc aKYQSWhhRICwauGXNuIKLflgl12DWLJvhXpue3BCrEEw8MioONqG2dpUbZYaUBiI bWo63A/SapC1TyyPan23z5AGtqTbh1OdJA+nd2kwgv055DHx6AzSk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=forgive, Blake, blake, Hx-languages-length:1509 X-HELO: mail-it0-f42.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+n3TusgY5URKzVH6upqN4ftpW0bK5Tn5pWf4RghQ9tg=; b=DzrwQpn/mRFbpDvROLKMym6BnvycNHTrJIkGzEcFBkVOkgcoAc1efCKG8KNq2gUVvB dmhUgXv5IMypKnU37JX4ioVbI0OqtfZZtGaD+7rOPE48wvg73d7nKiVrUm4wraVhAXBN hZ6+eLn0yZacL/x/C7MmuiKKher3Qdsvb8siyXE8lqVjvcV90E5eD5/Vy0EdQlQ5Mq+q s06WlcEO0WdqNb/ytwZ5ZCtSOjrjf9Bhus0CpEulYNm4D9wyo59gMQDoFOv1LAQhoWt1 rgwNTsAzwghmD7GxnK+TfN0yyQqTJ7JM/Qn6u86lNlv8oHN+nRjW2BnLbjrtjU7fVzrE 3Ccw== X-Gm-Message-State: AKS2vOwqkv0nQOPvqjZX6u5es+dJfr+Usf+CCct4QrIQkzzGq714pyIk dPLIePYm4v/3gma2 X-Received: by 10.36.70.7 with SMTP id j7mr4299630itb.89.1497363069875; Tue, 13 Jun 2017 07:11:09 -0700 (PDT) Subject: Re: CR-LF handling behavior of SED changed recently - this breaks a lot of MinGW cross build scripts To: cygwin AT cygwin DOT com References: <0F7D3B1B3C4B894D824F5B822E3E5A175B2636E4 AT IRSMSX103 DOT ger DOT corp DOT intel DOT com> <0F7D3B1B3C4B894D824F5B822E3E5A175B26CE47 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com> <59399CC5 DOT 60900 AT tlinx DOT org> <417f84ac-5d9f-dc50-e912-973e90b8a128 AT redhat DOT com> <0F7D3B1B3C4B894D824F5B822E3E5A175B26F278 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com> <34b26965-34c2-b5f0-a3f2-b2c3df344b08 AT gmail DOT com> <0F7D3B1B3C4B894D824F5B822E3E5A175B270518 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com> <5313de97-d9bd-d9c9-cb4a-254a3eadcf4a AT redhat DOT com> <3100fec0-bed0-f2fd-fe3c-11e5580d80f0 AT redhat DOT com> From: cyg Simple Message-ID: Date: Tue, 13 Jun 2017 10:11:11 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <3100fec0-bed0-f2fd-fe3c-11e5580d80f0@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes On 6/10/2017 10:30 PM, Eric Blake wrote: > On 06/10/2017 08:48 AM, cyg Simple wrote: > >> >> Uhm, 'wt' and 'wb' came from MS itself. > > Not quite. fopen(,"wb") comes from POSIX. "wb" is probably a microsoft > extension, but it is certainly not in POSIX nor in glibc. > I think it's a C standard so it should be in glibc. It may be mentioned in the POSIX standard as in support of the C standard. >> GNU GCC was adapted to allow it > > Huh? It's not whether the compiler allows it, but whether libc allows > it. ALL libc that are remotely close to POSIX compliant support > fopen(,"wb"), but only Windows platforms (and NOT glibc) support > fopen(,"wt"). > Looking at http://www.cplusplus.com/reference/cstdio/fopen/ I see: "If additional characters follow the sequence, the behavior depends on the library implementation: some implementations may ignore additional characters so that for example an additional "t" (sometimes used to explicitly state a text file) is accepted." There is also a lot of discussion about the topic at: https://stackoverflow.com/questions/229924/difference-between-files-writen-in-binary-and-text-mode As for glibc, it will just ignore the extra character but it allows the use of "wt"; it just means nothing to that C runtime library. It does aide in portable code though. As for me conflating GCC with a C runtime - please forgive my lapse in memory. -- cyg Simple -- 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