From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1278 invoked by alias); 9 Oct 2011 18:23:21 -0000 Received: (qmail 1265 invoked by uid 22791); 9 Oct 2011 18:23:20 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from idcmail-mo1so.shaw.ca (HELO idcmail-mo1so.shaw.ca) (24.71.223.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Oct 2011 18:23:07 +0000 Received: from pd2ml2so-ssvc.prod.shaw.ca ([10.0.141.134]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 09 Oct 2011 12:23:05 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=I0jFHxriRJwyplOnjK2nOSNCO7GacXBAI5CCNqI8fuI= 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=2KUf1mbJAAAA:8 a=vt4-FNnFXFX0bfqKlNMA:9 a=QEXdDO2ut3YA:10 a=NsFnkn2YGo8A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO kylheku.com) ([24.85.131.247]) by pd2ml2so-dmz.prod.shaw.ca with ESMTP; 09 Oct 2011 12:23:05 -0600 Received: from www-data by kylheku.com with local (Exim 4.69) (envelope-from ) id 1RCy1j-0008JC-8U for cygwin@cygwin.com; Sun, 09 Oct 2011 11:23:07 -0700 To: Subject: Re: stdio.h: broken standard compliance. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Sun, 09 Oct 2011 18:23:00 -0000 From: Kaz Kylheku In-Reply-To: <011d066ef0c80ba22bccc432fbc1b5fc@127.0.0.1> References: <011d066ef0c80ba22bccc432fbc1b5fc@127.0.0.1> Message-ID: X-Sender: kaz@kylheku.com User-Agent: Roundcube Webmail/0.4 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 X-SW-Source: 2011-10/txt/msg00131.txt.bz2 On Sun, 09 Oct 2011 11:08:58 -0700, Kaz Kylheku wrote: > reason, I cannot get a warning about fileno from this test case if > I add a reference to it. I will try to produce a minimal repro test > case for that. In my real program I have -Wall, and I'm not taking the function pointers. With -Wall we get warnings about implicit declarations. So, here is a better test case which shows that these identifiers are not declared when they should be. Of course the two errors occur without -Wall. $ cat posix-ansi.c #include void foo(void) { int (*f1)(FILE *) = fileno; int (*f2)(FILE *) = pclose; } int main(void) { int x = fileno(stdin); pclose(NULL); return 0; } $ gcc -Wall -ansi -D_POSIX_C_SOURCE=2 posix-ansi.c posix-ansi.c: In function 'foo': posix-ansi.c:5:23: error: 'fileno' undeclared (first use in this function) posix-ansi.c:5:23: note: each undeclared identifier is reported only once for ea ch function it appears in posix-ansi.c:6:23: error: 'pclose' undeclared (first use in this function) posix-ansi.c:6:9: warning: unused variable 'f2' posix-ansi.c:5:9: warning: unused variable 'f1' posix-ansi.c: In function 'main': posix-ansi.c:11:3: warning: implicit declaration of function 'fileno' posix-ansi.c:12:3: warning: implicit declaration of function 'pclose' posix-ansi.c:11:7: warning: unused variable 'x' -- 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