public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: KIMURA Masaru <hiyuh.root@gmail.com>
To: cygwin@cygwin.com
Subject: Re: __STRICT_ANSI__ and stdio.h
Date: Mon, 14 Dec 2015 04:56:00 -0000	[thread overview]
Message-ID: <CAPYQg33bDtta3=D2bZeswz1zTgrw1m-5rPNRLeayVEY3zp3E0w@mail.gmail.com> (raw)
In-Reply-To: <566DA207.3080008@gmail.com>

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?
so you mean linux (maybe glibc?) is wrong and cygwin (maybe newlib?) is right?

w/ attached source that uses popen()/pclose() via gcc -std=c99,

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[]) {

                          ^                          ^

Peace,

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

  reply	other threads:[~2015-12-14  4:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12  7:51 KIMURA Masaru
2015-12-13 16:51 ` cyg Simple
2015-12-14  4:56   ` KIMURA Masaru [this message]
2015-12-14  4:58     ` KIMURA Masaru
2015-12-14 13:34     ` cyg Simple
2015-12-14 14:06 ` Corinna Vinschen
2015-12-14 17:17   ` KIMURA Masaru
2015-12-15  9:30     ` Corinna Vinschen
2015-12-15 15:58       ` KIMURA Masaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPYQg33bDtta3=D2bZeswz1zTgrw1m-5rPNRLeayVEY3zp3E0w@mail.gmail.com' \
    --to=hiyuh.root@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).