delorie.com/archives/browse.cgi | search |
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=HuTr5ePOZ0TLYi+F | |
AeNhNh/IUx+c7W7bDNHiwnvUpYJHa8WQENRqXRwd6oC9uuGuMhrmS+h3yH8kQUoP | |
RtayfIWylPGvVW3i+vZEKx0yiWF+PhD+NyGzRkF0y1hhPGGWhz1tQBaD/K5N/KhU | |
xDJp+08M2UyOyuUpgFnjA9k12xw= | |
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=AvwwLeNlxFnQWZL4mwLRyb | |
3b5oo=; b=Jq7zeqhq0ecM4Yt7K1b7UFH5YvgwJfjv/osTjuNSZaimqikXQfMoi2 | |
DDk2zJuBfQRRqwfeGBGdXlIlCTma2Nn5pGAEzYjInEmi/MC81DgvUENc8a+ZkJQX | |
Ub+MOfMfmWl92ak3eukcZvieadwOf4SaKmyPVE4NTvNzZYh6L1bq8= | |
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 |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 |
X-HELO: | mail-io0-f171.google.com |
X-Received: | by 10.107.136.39 with SMTP id k39mr36069012iod.0.1450100065948; Mon, 14 Dec 2015 05:34:25 -0800 (PST) |
Subject: | Re: __STRICT_ANSI__ and stdio.h |
To: | cygwin AT cygwin DOT com |
References: | <CAPYQg31yUkpu9oC1cfWTmxaBANBYcd4X18RY9Q+BVpx-o=nLBw AT mail DOT gmail DOT com> <566DA207 DOT 3080008 AT gmail DOT com> <CAPYQg33bDtta3=D2bZeswz1zTgrw1m-5rPNRLeayVEY3zp3E0w AT mail DOT gmail DOT com> |
From: | cyg Simple <cygsimple AT gmail DOT com> |
X-Enigmail-Draft-Status: | N1110 |
Message-ID: | <566EC57B.102@gmail.com> |
Date: | Mon, 14 Dec 2015 08:34:51 -0500 |
User-Agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
MIME-Version: | 1.0 |
In-Reply-To: | <CAPYQg33bDtta3=D2bZeswz1zTgrw1m-5rPNRLeayVEY3zp3E0w@mail.gmail.com> |
X-IsSubscribed: | yes |
On 12/13/2015 11:56 PM, KIMURA Masaru wrote: > Hi, > >>> is cygwin's __STRICT_ANSI__ and stdio.h behavior not so compatible to glibc's? >>> especially, i meant routines in POSIX 1003.1:2001 (popen(), pclose(), etc). >>> for a specific example, see a cparser issue[1] i submitted. >>> >> >> Cygwin isn't wrong. __STRICT_ANSI__ doesn't mix with POSIX. >> __STRICT_ANSI__ definitions is what you should look at for the defined >> API; not POSIX 1003.1:2001. > > then why does glibc look accepting -std=c99 -D_POSIX_C_SOURCE=200809L? You'll have to ask glibc why it does this. That doesn't change the fact that -std=c99 implies -ansi in gcc. And you define what ever you like with -D on the command line; regardless if it is right or wrong. > so you mean linux (maybe glibc?) is wrong and cygwin (maybe newlib?) is right? Maybe both are correct and the discrepancy is implementation specific. Maybe you mean the build of glibc uses the above but glibc is defining the functions and not just declaring them. If glibc headers are declaring popen()/pclose() even if __STRICT_ANSI__ is defined I would dare to say they are incorrect in implementation. > > w/ attached source that uses popen()/pclose() via gcc -std=c99, > Attaching source code doesn't resolve the fact that popen()/pclose() are POSIX specific and you've asked for __STRICT_ANSI__ which eliminates the declarations that are not ANSI specific. > on cygwin (maybe newlib?), i got, > p.c: In function ‘main’: > p.c:5:2: warning: implicit declaration of function ‘popen’ > [-Wimplicit-function-declaration] > FILE *pp = popen("cat", "w"); > ^ > p.c:5:13: warning: initialization makes pointer from integer without a cast > FILE *pp = popen("cat", "w"); > ^ > p.c:12:3: warning: implicit declaration of function ‘pclose’ > [-Wimplicit-function-declaration] > int err = pclose(pp); > ^ > > on linux (maybe glibc?), i got, > p.c: In function 'main': > p.c:4:14: warning: unused parameter 'argc' [-Wunused-parameter] > int main(int argc, char *argv[]) { > ^ > p.c:4:26: warning: unused parameter 'argv' [-Wunused-parameter] > int main(int argc, char *argv[]) { > > ^ ^ Again, implementation specifics maybe. Try with -pedantic to see if it changes the result. -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |