Re: [PATCH 0/5] New warning: -Wstring-plus-int (PR c++/62181)

2017-02-22 Thread Jeff Law

On 02/22/2017 04:00 AM, Xi Ruoyao wrote:

Hi,

I've implemented -Wstring-plus-int (like the one in CLANG) for GCC. I've
bootstrapped GCC with my patches and runned dejaGNU tests.

My patches are for both C and C++ (like CLANG).

Unlike CLANG, this option is not enabled by default (or GCC won't
bootstrap with -Werror).
Note that the GCC project is currently in "stage4" of its 
development/release cycle.  Meaning only regression bugfixes are being 
considered for integration.  This stage will last until the gcc-7 
release is made.


Your new warning will be reviewed once the development team starts 
looking at gcc-8 work.


THanks,
Jeff



[PATCH 0/5] New warning: -Wstring-plus-int (PR c++/62181)

2017-02-22 Thread Xi Ruoyao
Hi,

I've implemented -Wstring-plus-int (like the one in CLANG) for GCC. I've
bootstrapped GCC with my patches and runned dejaGNU tests.

My patches are for both C and C++ (like CLANG).

Unlike CLANG, this option is not enabled by default (or GCC won't
bootstrap with -Werror).


Xi Ruoyao (5):
  Move char_type_p prototype into c-common.h
  c++: New warning option -Wstring-plus-int
  c: New warning option -Wstring-plus-int
  Document warning option -Wstring-plus-int
  New tests for option -Wstring-plus-int

 gcc/c-family/c-common.h   |  3 +++
 gcc/c-family/c-warn.c | 34 ++
 gcc/c-family/c.opt|  5 
 gcc/c/c-typeck.c  | 32 +++-
 gcc/cp/call.c | 35 +++
 gcc/cp/cp-tree.h  |  1 -
 gcc/cp/tree.c |  2 +-
 gcc/doc/invoke.texi   |  8 +-
 gcc/testsuite/c-c++-common/Wstring-plus-int.c | 35 +++
 gcc/testsuite/g++.dg/Wstring-plus-int-1.C | 20 +++
 gcc/testsuite/g++.dg/Wstring-plus-int-2.C | 32 
 gcc/testsuite/gcc.dg/Wstring-plus-int.c   | 17 +
 12 files changed, 220 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/Wstring-plus-int.c
 create mode 100644 gcc/testsuite/g++.dg/Wstring-plus-int-1.C
 create mode 100644 gcc/testsuite/g++.dg/Wstring-plus-int-2.C
 create mode 100644 gcc/testsuite/gcc.dg/Wstring-plus-int.c

-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University