From: Jim Wilson <wilson@tuliptree.org>
To: Igor Bukanov <igor@mir2.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: GCC accepts dynamically-sized array in sizeof with -std=c89
Date: Fri, 18 Apr 2008 18:27:00 -0000 [thread overview]
Message-ID: <4808E750.3050200@tuliptree.org> (raw)
In-Reply-To: <7dee4710804160352l7438e709t5fa3418199a3b03@mail.gmail.com>
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
next prev parent reply other threads:[~2008-04-18 18:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-16 14:15 Igor Bukanov
2008-04-18 18:27 ` Jim Wilson [this message]
2008-04-19 4:54 ` Igor Bukanov
2008-04-19 7:03 ` Igor Bukanov
2008-04-19 9:33 ` Igor Bukanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4808E750.3050200@tuliptree.org \
--to=wilson@tuliptree.org \
--cc=gcc-help@gcc.gnu.org \
--cc=igor@mir2.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).