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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=Rn hffHXWzhb7LaPmKuNYXALU8M98eEjMNFuQ0mbqBflkFXR1wMrKNiz4BoEIwX7jVS UEuCxSEA8/Jh5kUIMuhk5Zd+/OgWIRorPAW2t+dKcMGjVYYhmbBB0m7nBB0cG9dv NNCMk03AMtfnHIlR52AFh1RovU3FfkVvisQQeGbws= 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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=ZMGHHPcp 2ukO2moX1+L60wTS0xc=; b=lwyHCpBj7iQwnMZ5tlaNmDNx+lT7i7iGKbBrc709 TwVYQzSCc5c8Fsd1FbtbklTF1LbJ9zVFhlCaIb+G5FFAY5cQq1d7U2fs97B2gq3p 0UGL/yronWpti9Frotv46OFBWv4z2cI87PdaJfLUozPNcEWydukn+GX4Xt+Pl+qP P0k= 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=-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 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) In-Reply-To: <20151215093020.GA12827@calimero.vinschen.de> References: <20151214140649 DOT GB29983 AT calimero DOT vinschen DOT de> <20151215093020 DOT GA12827 AT calimero DOT vinschen DOT de> Date: Wed, 16 Dec 2015 00:58:34 +0900 Message-ID: Subject: Re: __STRICT_ANSI__ and stdio.h From: KIMURA Masaru To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes 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