From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4012 invoked by alias); 14 Dec 2015 04:58:02 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 3362 invoked by uid 89); 14 Dec 2015 04:58:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f176.google.com Received: from mail-ob0-f176.google.com (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 14 Dec 2015 04:57:59 +0000 Received: by obciw8 with SMTP id iw8so123510186obc.1 for ; Sun, 13 Dec 2015 20:57:57 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.95.34 with SMTP id dh2mr14123826oeb.28.1450069077420; Sun, 13 Dec 2015 20:57:57 -0800 (PST) Received: by 10.76.107.238 with HTTP; Sun, 13 Dec 2015 20:57:57 -0800 (PST) In-Reply-To: References: <566DA207.3080008@gmail.com> Date: Mon, 14 Dec 2015 04:58:00 -0000 Message-ID: Subject: Re: __STRICT_ANSI__ and stdio.h From: KIMURA Masaru To: cygwin@cygwin.com Content-Type: multipart/mixed; boundary=089e01177341429c050526d484f1 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00150.txt.bz2 --089e01177341429c050526d484f1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1577 oops! forgot to attach p.c, so resending now... > Hi, > >>> is cygwin's __STRICT_ANSI__ and stdio.h behavior not so compatible to g= libc's? >>> especially, i meant routines in POSIX 1003.1:2001 (popen(), pclose(), e= tc). >>> 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=3Dc99 -D_POSIX_C_SOURCE=3D200809L? > so you mean linux (maybe glibc?) is wrong and cygwin (maybe newlib?) is r= ight? > > w/ attached source that uses popen()/pclose() via gcc -std=3Dc99, > > on cygwin (maybe newlib?), i got, > p.c: In function =E2=80=98main=E2=80=99: > p.c:5:2: warning: implicit declaration of function =E2=80=98popen=E2=80=99 > [-Wimplicit-function-declaration] > FILE *pp =3D popen("cat", "w"); > ^ > p.c:5:13: warning: initialization makes pointer from integer without a ca= st > FILE *pp =3D popen("cat", "w"); > ^ > p.c:12:3: warning: implicit declaration of function =E2=80=98pclose=E2=80= =99 > [-Wimplicit-function-declaration] > int err =3D 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[]) { > > ^ ^ > > Peace, --089e01177341429c050526d484f1 Content-Type: text/x-csrc; charset=US-ASCII; name="p.c" Content-Disposition: attachment; filename="p.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ii5hoi8w0 Content-length: 379 I2RlZmluZSBfUE9TSVhfQ19TT1VSQ0UgMjAwODA5TAojaW5jbHVkZSA8YXNz ZXJ0Lmg+CiNpbmNsdWRlIDxzdGRpby5oPgppbnQgbWFpbihpbnQgYXJnYywg Y2hhciAqYXJndltdKSB7CglGSUxFICpwcCA9IHBvcGVuKCJjYXQiLCAidyIp OwoJYXNzZXJ0KHBwICE9IE5VTEwpOwoJewoJCWludCBuID0gZnByaW50Zihw cCwgImZvb1xuIik7CgkJYXNzZXJ0KG4gPj0gMCk7Cgl9Cgl7CgkJaW50IGVy ciA9IHBjbG9zZShwcCk7CgkJYXNzZXJ0KGVyciAhPSAtMSk7Cgl9CglyZXR1 cm4gMDsKfQo= --089e01177341429c050526d484f1 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- 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 --089e01177341429c050526d484f1--