From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14117 invoked by alias); 18 Apr 2008 18:24:40 -0000 Received: (qmail 14108 invoked by uid 22791); 18 Apr 2008 18:24:40 -0000 X-Spam-Check-By: sourceware.org Received: from smtp105.biz.mail.mud.yahoo.com (HELO smtp105.biz.mail.mud.yahoo.com) (68.142.200.253) by sourceware.org (qpsmtpd/0.31) with SMTP; Fri, 18 Apr 2008 18:24:20 +0000 Received: (qmail 12538 invoked from network); 18 Apr 2008 18:24:18 -0000 Received: from unknown (HELO localhost.localdomain) (wilson@tuliptree.org@69.110.32.105 with plain) by smtp105.biz.mail.mud.yahoo.com with SMTP; 18 Apr 2008 18:24:18 -0000 X-YMail-OSG: CvvAfJkVM1lHeVx0HfNInrBdJ8YZvUkVaOrBiNoP4HI.EJNaP4x1s3EWhRVhd0n4.thGcFpNlDoJLmXOeUziCGtHo.EwuwC6ILCThA-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4808E750.3050200@tuliptree.org> Date: Fri, 18 Apr 2008 18:27:00 -0000 From: Jim Wilson User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Igor Bukanov CC: gcc-help@gcc.gnu.org Subject: Re: GCC accepts dynamically-sized array in sizeof with -std=c89 References: <7dee4710804160352l7438e709t5fa3418199a3b03@mail.gmail.com> In-Reply-To: <7dee4710804160352l7438e709t5fa3418199a3b03@mail.gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00253.txt.bz2 Igor Bukanov wrote: > With GCC 4.3.0 it compiles without a warning even with -pedantic > -std=c89 even if the program uses dynamic array feature from C99: It works for me. localhost$ ./xgcc -B./ -std=c89 tmp2.c localhost$ ./xgcc -B./ -std=c89 -pedantic tmp2.c tmp2.c: In function ‘f’: tmp2.c:5: warning: ISO C90 forbids variable length array localhost$ ./xgcc -B./ -v Reading specs from ./specs Target: i686-pc-linux-gnu Configured with: ../gcc/configure --enable-languages=c Thread model: posix gcc version 4.3.1 20080411 (prerelease) [gcc-4_3-branch revision 134209] (GCC) Adding -pedantic does generate the warning. Perhaps you expected a warning without -pedantic? If you read the docs carefully, you will see that -std=c89 enables all features of that standard, but does not disable GNU extensions to that standard. You need -pedantic for that. Jim