From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16165 invoked by alias); 8 Dec 2002 02:26:02 -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 16129 invoked by uid 71); 8 Dec 2002 02:26:02 -0000 Resent-Date: 8 Dec 2002 02:26:02 -0000 Resent-Message-ID: <20021208022602.16128.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, theaterfire@yahoo.com Received: (qmail 29517 invoked by uid 61); 8 Dec 2002 02:19:17 -0000 Message-Id: <20021208021917.29516.qmail@sources.redhat.com> Date: Sat, 07 Dec 2002 18:26:00 -0000 From: theaterfire@yahoo.com Reply-To: theaterfire@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/8868: GCC 3.2, 3.2.1 fail to compile with functions in C99 mode X-SW-Source: 2002-12/txt/msg00455.txt.bz2 List-Id: >Number: 8868 >Category: c >Synopsis: GCC 3.2, 3.2.1 fail to compile with functions in C99 mode >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Dec 07 18:26:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Tim >Release: gcc version 3.2 (mingw special 20020817-1) and others >Organization: >Environment: Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared Thread model: win32 gcc version 3.2 (mingw special 20020817-1) >Description: 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. The test program below has been tested to compile properly under gcc 2.95.3 (mingw), gcc 3.0.2 (Linux, glibc 2.1, C89 and C99), gcc 3.2 (mingw, C89), and gcc 3.2.1 (Linux, C89). It has failed testing under gcc 3.2 (Solaris, mingw, C99) and gcc 3.2.1 (Linux). 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 . Unfortunately, I do not have the resources to test this behavior under the latest development snapshot. ~$ gcc -o testme testme.c -std=c99 testme.c: In function `main': testme.c:6: storage size of `filestat' isn't known testme.c:12: warning: implicit declaration of function `fstat' testme.c:12: warning: implicit declaration of function `fileno' >How-To-Repeat: /* test_stat.c */ #include #include int main() { struct stat filestat; FILE *openfile; int test; openfile = fopen("anyfile.txt", "r"); fstat(fileno(openfile), &filestat); test = filestat.st_size; printf("test = %d\n", test); fclose(openfile); return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: