From patchwork Wed Feb 22 11:01:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 731066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vSvZs10Fgz9s78 for ; Wed, 22 Feb 2017 22:02:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dADv/f/v"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; q=dns; s=default; b=fwycMM4EGMRw3i3Y zwObiQGQjH0s22XxS0Bljdxb73aSFNHlVVI5r02LgvtcralPfVLG+erZuHfdzRdZ 9X9/aZZO01U6fI5DLXQAsL/OCKXd2FRn7rVufZtvifSWDX1fhQ4g4emoJTEv2sIy mdr31O8UO68M+EVXPXYbt4Y3EBk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; s=default; bh=DAZRDl6TNMbDRh1h4PI3AL dYGDk=; b=dADv/f/v8zOfkz/vPpztSbz1S3awV5cl0tHcKCwn8sNr1E4DHk/IxE HlaB56oaSyWjuVq65EGay30QsKiaUlcnSP4DBRtx21prB2we1Zc+56fa7Sago20V Yl+mQ3nb8SQ5iECo4Zgxaa+y5QiN3mmfLD3aLEm5GUsVLbNj5AnGc= Received: (qmail 24639 invoked by alias); 22 Feb 2017 11:01:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24564 invoked by uid 89); 22 Feb 2017 11:01:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, URIBL_SBL autolearn=ham version=3.3.2 spammy=H*Ad:D*edu.cn, H*Ad:D*cn, Hx-languages-length:1672, H*F:D*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:01:30 +0000 Received: from xry111-laptop (xry111-laptop [171.118.139.181]) by stu.xidian.edu.cn (eYou MTA v8.1.0) with ESMTP id ddfa1003348ab1786c84568b99aca282 for ; Wed, 22 Feb 2017 19:11:42 +0800 X-Eyou-Smtpauth: ryxi@stu.xidian.edu.cn Message-ID: <1487761285.2882.67.camel@stu.xidian.edu.cn> Subject: [PATCH 4/5] Document warning option -Wstring-plus-int From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: ryxi@stu.xidian.edu.cn Date: Wed, 22 Feb 2017 19:01:25 +0800 Mime-Version: 1.0 X-Eyou-Sender: This patch adds document of -Wstring-plus-int. gcc/ChangeLog: 2017-02-22  Xi Ruoyao   * doc/invoke.texi (Warning Options): Document -Wstring-plus-int ---  gcc/doc/invoke.texi | 8 +++++++-  1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e1a1d13..6e929e8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -307,7 +307,7 @@ Objective-C and Objective-C++ Dialects}.  -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol  -Wstack-protector  -Wstack-usage=@var{len}  -Wstrict-aliasing @gol  -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol --Wstringop-overflow=@var{n} @gol +-Wstringop-overflow=@var{n} -Wstring-plus-int @gol  -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol  -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol  -Wmissing-format-attribute  -Wsubobject-linkage @gol @@ -5046,6 +5046,12 @@ whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this  setting of the option may result in warnings for benign code.  @end table   +@item -Wstring-plus-int +@opindex Wstring-plus-int +@opindex Wno-string-plus-int +Warn for adding an integer to a string pointer or string literal, +which seems an ill-formed attempt to append to the string. +  @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}  @opindex Wsuggest-attribute=  @opindex Wno-suggest-attribute=