From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36051 invoked by alias); 15 Dec 2015 15:58:40 -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 36013 invoked by uid 89); 15 Dec 2015 15:58:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f51.google.com Received: from mail-oi0-f51.google.com (HELO mail-oi0-f51.google.com) (209.85.218.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 15 Dec 2015 15:58:37 +0000 Received: by mail-oi0-f51.google.com with SMTP id i186so7475572oia.2 for ; Tue, 15 Dec 2015 07:58:37 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.205.137 with SMTP id d131mr29978143oig.56.1450195115048; Tue, 15 Dec 2015 07:58:35 -0800 (PST) Received: by 10.76.107.238 with HTTP; Tue, 15 Dec 2015 07:58:34 -0800 (PST) In-Reply-To: <20151215093020.GA12827@calimero.vinschen.de> References: <20151214140649.GB29983@calimero.vinschen.de> <20151215093020.GA12827@calimero.vinschen.de> Date: Tue, 15 Dec 2015 15:58:00 -0000 Message-ID: Subject: Re: __STRICT_ANSI__ and stdio.h From: KIMURA Masaru To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00169.txt.bz2 Hi, >> >> is cygwin's __STRICT_ANSI__ and stdio.h behavior not so compatible to glibc's? >> > >> > Cygwin is using newlib, newlib is BSD based. We introduced the >> > compatibility checking macros from FreeBSD lately. >> >> i roughly checked FreeBSD include/stdio.h and sys/sys/cdefs.h. >> https://github.com/freebsd/freebsd/blob/master/include/stdio.h >> https://github.com/freebsd/freebsd/blob/master/sys/sys/cdefs.h >> >> it looks very different to newlib's. > > Yes, it does. Newlib has a long history diverging from the BSDs to > support embedded systems in the first place, and compatibility checking > macros other than __STRICT_ANSI__ and __POSIX_SOURCE weren't much of a > concern for a long time. > >> FreeBSD has visibility for popen()/pclose() if __POSIX_VISIBLE >= 199209, >> it looks no checking about __STRICT_ANSI__ in their cdefs.h. > > Yeah, that's history as described above. popen gets declared in newlib > if __STRICT_ANSI__ is not defined right now. > >> only one thing i worried about is _ANSI_SOURCE in their cdefs.h, >> (b/c i don't understand where _ANSI_SOURCE comes from...) >> but it looks _POSIX_C_SOURCE wins anyway. >> for ease to see, i'd attach simplified their cdefs.h for their >> visibility handling. > > I don't see the difference, see below. The big differences in newlib > are the additional handling of _GNU_SOURCE and the old usage of > __STRICT_ANSI__ in some circumstances which haven't been replaced by another > usage of compatibility macros yet. > > But here's the deal: Newlib is a volunteer-driven project. If the > compatiblity checking macros are not correct or not correctly used in > all circumstances, newlib is happily open to patches. Just send them > to the newlib AT sourceware DOT org mailing list. > >> #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 >> #undef _POSIX_C_SOURCE >> #define _POSIX_C_SOURCE 199009 >> #endif > > Same in Newlib's sys/cdefs.h. > > [SNIP] ah, i didn't check newlib's sys/cdefs.h. thank you for correcting my misunderstanding. apart from standard compliance correctness, it's good to hear newlib can deal it. if i had more spare time to dive its source, i'd like to do it. 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