From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18737 invoked by alias); 22 Feb 2017 11:00:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18624 invoked by uid 89); 22 Feb 2017 11:00:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_50,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,URIBL_SBL autolearn=ham version=3.3.2 spammy=H*F:D*edu.cn, Ruoyao, D*edu.cn, D*stu.xidian.edu.cn X-HELO: stu.xidian.edu.cn Received: from stumail.xidian.edu.cn (HELO stu.xidian.edu.cn) (202.117.112.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 22 Feb 2017 11:00:17 +0000 Received: from xry111-laptop (xry111-laptop [171.118.139.181]) by stu.xidian.edu.cn (eYou MTA v8.1.0) with ESMTP id 221bbf0676c43f3a90bbc76fa444125c for ; Wed, 22 Feb 2017 19:10:24 +0800 X-Eyou-Smtpauth: ryxi@stu.xidian.edu.cn Message-ID: <1487761207.2882.63.camel@stu.xidian.edu.cn> Subject: [PATCH 0/5] New warning: -Wstring-plus-int (PR c++/62181) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: ryxi@stu.xidian.edu.cn Date: Wed, 22 Feb 2017 11:01:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Eyou-Sender: X-SW-Source: 2017-02/txt/msg01372.txt.bz2 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