X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=sOeZmqKXo9QeAvPHcA4bYEQFU2ce9l+aXDqfA8Y5Yr0= c=1 sm=1 a=W5crty74aesA:10 a=Bqtapk49eCgA:10 a=SV9grZ613K4A:10 a=BLceEmwcHowA:10 a=i7s4YuWtaOcA:10 a=IkcTkHD0fZMA:10 a=IaHBZPgZ0vV7m0nTkA8unw==:17 a=mDV3o1hIAAAA:8 a=uZvujYp8AAAA:8 a=gfyxrlcoK0fQs-ETSeIA:9 a=LGmIR0ZEIUtg8YCERcgA:7 a=QEXdDO2ut3YA:10 a=93JMsz_FyScA:10 a=nv2HPNHG-XcA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 To: Subject: Re: stdio.h: broken standard compliance. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 10 Oct 2011 11:42:45 -0700 From: Kaz Kylheku Cc: Message-ID: <203df9f173be7f13d23b3e7c0fc831c1@127.0.0.1> X-Sender: kaz AT kylheku DOT com User-Agent: Roundcube Webmail/0.4 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 Corinna Vinschen writes: > > $ gcc -Wall -ansi -D_POSIX_C_SOURCE=2 posix-ansi.c ^^^^^ > fileno and pclose are *not* ANSI functions. Therefore, if you define > -ansi, you get the below errors. The newlib headers have explicit > #ifndef __STRICT_ANSI__ guards around the non-ANSI definitions. Hi Corinna, (Could you use "reply all?" for discussions so the original person is included, but the mailing list is kept in the loop with a CC? I had to dig your reply out of the online archives.) I do not believe that your interpretation of the applicable standards is entirely correct. The -ansi flag tells the GNU *compiler* to disable its built-in extensions. So for instance the block evaluation syntax ({ expr1; ... ; exprn }) won't be available. The -D_POSIX_C_SOURCE=2 tells the *library headers* to enable their extensions to a certain revision of POSIX. With -D_POSIX_SOURCE, programs must see pclose and fileno declared in It is not correct for those headers to be testing GCC's compliance level with __STRICT_ANSI__ to determine whether to reveal these symbols. FYI: Summary of Feature Test Macros in the glibc documentation: http://www.gnu.org/s/hello/manual/libc/Feature-Test-Macros.html In your Linux manual pages: $ man 7 feature_test_macros In the Single Unix Specification: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02 Cheers ... -- 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