public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)
@ 2017-06-12  1:26 Xi Ruoyao
  2017-06-12  1:31 ` [PATCH 1/6] " Xi Ruoyao
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Xi Ruoyao @ 2017-06-12  1:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: ryxi

Hi,

I've implemented -Wstring-plus-int and -Wstring-plus-char (like their
counterpart in Clang) for GCC.

This series of patch has been bootstrapped and regtested.  OK for trunk?

Currently these options are not enabled by default like Clang does.
Maybe we could make them enabled by default or by -Wall/-Wextra later.

Xi Ruoyao (6):
  Move char_type_p prototype into c-common.h
  New warning option -Wstring-plus-int
  New warning option -Wstring-plus-char
  New tests for -Wstring-plus-int
  New tests for -Wstring-plus-char
  Document new warning options

 gcc/c-family/c-common.c                        | 25 ++++++++++++++++++++
 gcc/c-family/c-common.h                        |  2 ++
 gcc/c-family/c-warn.c                          | 22 ++++++++++++++++++
 gcc/c-family/c.opt                             | 10 ++++++++
 gcc/c/c-typeck.c                               | 17 +++++++++++++-
 gcc/cp/call.c                                  | 28 ++++++++++++++++++++++
 gcc/cp/cp-tree.h                               |  1 -
 gcc/cp/tree.c                                  |  2 +-
 gcc/doc/invoke.texi                            | 22 +++++++++++++++++-
 gcc/testsuite/c-c++-common/Wstring-plus-char.c | 26 +++++++++++++++++++++
 gcc/testsuite/c-c++-common/Wstring-plus-int.c  | 26 +++++++++++++++++++++
 gcc/testsuite/g++.dg/Wstring-plus-char-1.C     | 16 +++++++++++++
 gcc/testsuite/g++.dg/Wstring-plus-char-2.C     | 26 +++++++++++++++++++++
 gcc/testsuite/g++.dg/Wstring-plus-char-3.C     | 32 ++++++++++++++++++++++++++
 gcc/testsuite/g++.dg/Wstring-plus-int-1.C      |  9 ++++++++
 gcc/testsuite/g++.dg/Wstring-plus-int-2.C      | 10 ++++++++
 16 files changed, 270 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/Wstring-plus-char.c
 create mode 100644 gcc/testsuite/c-c++-common/Wstring-plus-int.c
 create mode 100644 gcc/testsuite/g++.dg/Wstring-plus-char-1.C
 create mode 100644 gcc/testsuite/g++.dg/Wstring-plus-char-2.C
 create mode 100644 gcc/testsuite/g++.dg/Wstring-plus-char-3.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


-- 
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-07-15 16:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12  1:26 [PATCH 0/6] New warnings -Wstring-plus-{char, int} (PR c++/62181) Xi Ruoyao
2017-06-12  1:31 ` [PATCH 1/6] " Xi Ruoyao
2017-06-12  1:32 ` [PATCH 2/6] " Xi Ruoyao
2017-06-19 16:51   ` Martin Sebor
2017-06-19 17:28     ` Xi Ruoyao
2017-06-19 18:44       ` Martin Sebor
2017-06-19 19:36         ` Xi Ruoyao
2017-06-22 10:26         ` Xi Ruoyao
2017-07-15 16:33           ` Gerald Pfeifer
2017-06-12  1:34 ` [PATCH 3/6] " Xi Ruoyao
2017-06-19 16:30   ` Martin Sebor
2017-06-19 17:35     ` Xi Ruoyao
2017-06-12  1:36 ` [PATCH 4/6] " Xi Ruoyao
2017-06-12  1:39 ` [PATCH 5/6] " Xi Ruoyao
2017-06-12  1:39 ` [PATCH 6/6] " Xi Ruoyao
2017-06-19 16:57   ` Martin Sebor
2017-06-19 12:43 ` [PING PATCH 0/6] " Xi Ruoyao
2017-06-19 16:20 ` [PATCH " Martin Sebor

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).