Seongbae Park - [PATCH]: Add a new option -Wvariable-length-array (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: "Seongbae Park"
- To: gcc-patches
- Date: Tue, 6 Feb 2007 16:03:13 -0800
- Subject: [PATCH]: Add a new option -Wvariable-length-array
Hi,
Currently -pedantic warns about any usage of variable-length array in non-C99 mode and in C++. However, -pendantic brings whole swath of warnings that it's not desirable in some circumstances. This patch adds a new flag -Wvariable-length-array which issues a warning for any variable-length array usage regardless of C99 or pedantic. The main intention is to support checking of coding styles that don't allow variable-length arrays. The patch is tested on i686-linux. Ok for mainline ?
ChangeLog 2007-02-06 Seongbae Park seongbae.park@gmail.com
* gcc/doc/invoke.texi (Wvariable-length-arra): New warning.
gcc/ChangeLog 2007-02-06 Seongbae Park seongbae.park@gmail.com * c-decl.c (grokdeclarator): Support new flag warn_vla. Use "variable length array" instead of "variable-sized array". * c.opt (Wvariable-length-array): New flag.
gcc/testsuite/ChangeLog 2007-02-06 Seongbae Park seongbae.park@gmail.com
* gcc.dg/wvariable-length-array-1.c: New test
* g++.dg/warn/Wvariable-length-array-1.C: New test
gcc/cp/ChangeLog 2007-02-06 Seongbae Park seongbae.park@gmail.com
* decl.c (compute_array_index_type): New warning flag warn_vla.
-- #pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com";
Attachment:wvla.diff.txt
Description: Text document
- Follow-Ups:
- Re: [PATCH]: Add a new option -Wvariable-length-array
* From: Joseph S. Myers
- Re: [PATCH]: Add a new option -Wvariable-length-array
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |