From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24986 invoked by alias); 8 Dec 2002 15:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24962 invoked by uid 71); 8 Dec 2002 15:26:01 -0000 Date: Sun, 08 Dec 2002 07:26:00 -0000 Message-ID: <20021208152601.24961.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/8868: GCC 3.2, 3.2.1 fail to compile with functions in C99 mode Reply-To: "Joseph S. Myers" X-SW-Source: 2002-12/txt/msg00463.txt.bz2 List-Id: The following reply was made to PR c/8868; it has been noted by GNATS. From: "Joseph S. Myers" To: Cc: , Subject: Re: c/8868: GCC 3.2, 3.2.1 fail to compile with functions in C99 mode Date: Sun, 8 Dec 2002 15:17:06 +0000 (GMT) On 8 Dec 2002 theaterfire@yahoo.com wrote: > Using struct stat, stat(), or fstat() from causes > compilation to fail in gcc 3.2 under C99 mode. In some cases, it also > causes errors to be reported about other functions that compile > properly without the introduction of elements. This is clearly an issue with your library headers rather than with GCC. If you want to claim otherwise, you'll need to provide preprocessed source that GCC fails to compile in C99 mode but ought to compile, or the collection of source files it fails to preprocess correctly in C99 mode; you haven't provided anything that looks like a GCC testcase. Note that, according to POSIX, this isn't a library bug either unless you define _POSIX_SOURCE or _POSIX_C_SOURCE to an appropriate value (depending on the POSIX version you want, e.g. -D_POSIX_C_SOURCE=199506L for the previous edition of POSIX), since -std=c99 means C standard features only, no POSIX features, and including in such a mode yields undefined behavior. > If all elements are removed from the sample, it will > properly compile in C99 mode. Note that with the > elements, gcc will also warn of implicit declaration of fileno(), > included from . Of course. fileno() isn't part of C99, declaring it in strict C99 mode (without a feature test macro such as _POSIX_C_SOURCE) isn't allowed. -- Joseph S. Myers jsm28@cam.ac.uk