Message ID | 20221108145113.955321-1-qing.zhao@oracle.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2755715wru; Tue, 8 Nov 2022 06:54:48 -0800 (PST) X-Google-Smtp-Source: AMsMyM5rMIYB7Kdb1Hh0gfKHEZiDMvDwB9/8nqg1L2/jNV6TLD/FSKFDnQY9NXvg16UUB83xqwkp X-Received: by 2002:a17:906:9d14:b0:799:9ace:e868 with SMTP id fn20-20020a1709069d1400b007999acee868mr929587ejc.451.1667919288786; Tue, 08 Nov 2022 06:54:48 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ey3-20020a0564022a0300b00456964d3369si2283115edb.230.2022.11.08.06.54.48 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 06:54:48 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="F5Ta7/jn"; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B66533858421 for <ouuuleilei@gmail.com>; Tue, 8 Nov 2022 14:54:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B66533858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667919287; bh=sjedI6bCpXDEpqPUy+fSYoBPNsyUx0GO2OQkxtUbQC4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=F5Ta7/jndqYGwlxAPIN/MUebbdnQL+bQH87Tf/v4mDcJ6pHTD9+8r5p0fE9V+CWqV SqWGsqXF3gghNYNDS2ULhPgAWOyR9GDJ4O18EHPYalaVArQb4puTOO8CeSvixERdGC WV45R+1tKEHuriSFRbjgQjHTRdSsObIdfMR7Vlt4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 8855438582A6; Tue, 8 Nov 2022 14:53:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8855438582A6 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A8EnZLg022133; Tue, 8 Nov 2022 14:53:40 GMT Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kqryj82yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Nov 2022 14:53:38 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2A8CNGDa014660; Tue, 8 Nov 2022 14:51:19 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2170.outbound.protection.outlook.com [104.47.73.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kpcq1yne4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Nov 2022 14:51:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSOyJQc1bAbJmf4eyZCDIR+cdAzj4SAFtcwxNd3PCUOu2opCYMoIiQof8pE7c4HK7me0Ir0KXtzlBbjWQt8mUP2PZVb8BFYAKkp0R6CKhkgpSoV8js4RKmc8lGqhV3fbRWJ8QzIt7Jb55FxlWXEvwIvwkUB/7BQiCSsnMFf06qQXMVZ5QtuddDngLFNT+PinlqzMz9VBKhI20Xl5ARYoM0uEwc4tR9Yx7aFxXg3Qa1lVvQyyNQiD+CekOidw7Bvj8PUPHx7e+VVWt1RwhgRRPcv5LFFEcltE5EJBUWuzxq3So9XC0uSPQcuH2OJ/CL1Dn6z7ReXXYEAW4wi9A6p1sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sjedI6bCpXDEpqPUy+fSYoBPNsyUx0GO2OQkxtUbQC4=; b=j9AbD50aUjgTvc0Np+55xbKGf5HpxOnZqllCpDO7J0Z5kjGY3mm+wNo/3fmtDetKUUedq2jasmLnUmunm7uYinfNHDnJ45Z4WTGyLG2+CdYree1l95V0qaA2T6OQkRjHVR/6ed4KhZIlIBOlA4oCMeK37uB2mN0GYnaHledLysJiZ2VT+uAauIxy3mUDrDHDkpQrdPCZOj/5jRFW8s5N2zmncp9vRCFWdU3K27gjLgV/F+YjDs2oEhEjv3eOJVwWoOO0XrYOmdaiF91eaXzGV53EYSEw4AHhnakQ+6XPsON8paXcXyf4WlDpI5/aX3QG2Lu3r6zs1fcj8X+MKROjiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from CH2PR10MB4344.namprd10.prod.outlook.com (2603:10b6:610:af::19) by SJ0PR10MB4814.namprd10.prod.outlook.com (2603:10b6:a03:2d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Tue, 8 Nov 2022 14:51:17 +0000 Received: from CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::b18d:b9b8:8c1f:5f6e]) by CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::b18d:b9b8:8c1f:5f6e%8]) with mapi id 15.20.5791.027; Tue, 8 Nov 2022 14:51:16 +0000 To: rguenther@suse.de, joseph@codesourcery.com Cc: gcc-patches@gcc.gnu.org, keescook@chromium.org, siddhesh@gcc.gnu.org, Qing Zhao <qing.zhao@oracle.com> Subject: [PATCH 0/2] Add a new warning option -Wstrict-flex-array Date: Tue, 8 Nov 2022 14:51:11 +0000 Message-Id: <20221108145113.955321-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DS7PR05CA0015.namprd05.prod.outlook.com (2603:10b6:5:3b9::20) To CH2PR10MB4344.namprd10.prod.outlook.com (2603:10b6:610:af::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR10MB4344:EE_|SJ0PR10MB4814:EE_ X-MS-Office365-Filtering-Correlation-Id: f246b1b5-1c1c-4526-d1f7-08dac198b082 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DgESyz0PcxzdsV6v/g5uaGIXzxNQiI3MBki0k4vo7u9JO6p09S0LrjufHtaqvWqUY4ENlf7jX8HIEttPtuqA1wipvilnRBAcF3qVQQU743WSQGbyqfoKa3oRxQr6B6Wytih+3a5WDAFI1LRavggiOhYTNdEMXs8g79koGS24cuCGPizwk2vK22Qaa16OPENlmXg/pFInND8KZtG5G4MGoBUezQr1Kk5flfLjcVfN9+ZrZlxJRW9dthlDBzx0jnwMz2dx1pH33d/abaVUcJwNAxJKdfDmR4VMhNn6cP5HwXIF+dGOWPRPMiG3VhbhcHGUsSIXL7FBgNAHFshgRPLVn3/pe1q7ZOONoOrnC7RRZY+UErT4rmCrXIiHD6vzVCH4qRH28HDqRflHNvNssjb1wv1rVp7pZuw0mMBCA/GtFV/yxa3xeD6I5WELJ0B8DXWFqlh3IydS0wgLm1cry+CDmYmLjbmnRo0KrC6QvY4qljy3rA8SP1IE5BhVeZR1Q6iYoTM0KYWWXdaOH9YghPVSTLaSva2/SgdmNOYypHmdwQRu9ZOBOfZcn8DfcE/JKPgAFto0eF6Hn+Dcrw3jWo630bJFf5meLEI+hzEuVNWbG+NAsoFVd3soom4gkGnnv8iC/tvcil7sJwYk/5kWW6zTq/sfYBnQGnR2MWbw2RTBV802aMK8Roa6znPCqt66dcp1APAQckmDd9lN/4adK5osHA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR10MB4344.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(136003)(376002)(39860400002)(451199015)(2906002)(8676002)(316002)(66476007)(6512007)(44832011)(6506007)(36756003)(4326008)(5660300002)(8936002)(38100700002)(4743002)(66556008)(478600001)(6486002)(83380400001)(6666004)(107886003)(4744005)(66946007)(86362001)(186003)(41300700001)(2616005)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: waz19Z6VkZRXScGr7CL3KoffZGK7BFkLlWNRa004COL1XNIRPjx6aRx9Vi2Uh1uLdOF1JV+MMVEz7fvh2NBzwhAsRJTS+/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KNxpKhpx1lEZt4XvCOfdWNBZcbjURHbIsAS9QXy4OnIbMEkiM39/NiIn5lIytS+yMiKl4J3UvqIwJgEJ32ODs7Bg6umm3AJ8Uz7oemn2FTXCA+clQBFkezHu+lu9dQCr7jat/XfIfU13FQYPgla0nsOMLMEVpLHftI+e3oFJZZ8o12IG8e/5noVgd7FB0vEcVMlY0SZP3pRfiIOZEzL1F74W5VnMuQWjg/u2ir2CyutbrISXwUpKI5s2U927xB89ZcuQ7P4gs7lD1abDou/ux8ZjWhD5CVfnbvC8yC/VO2lZTkAOlZHVBItn6sIr/dbAIqkujyl0ZVT7sSeCP63SGMAbXDva3YdswtW8LI+R2pmuM76xZc2mREK7NjJizeH5Zb5O+/V4uTf2lkpYzb5x0cCCZWACa613c9Ubvwe0+eHRTngplcR/ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f246b1b5-1c1c-4526-d1f7-08dac198b082 X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4344.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2022 14:51:16.8930 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R/TRCNaDNFaTdT+NssrAYdgRyF4B/Y7oaSiPajpwO+wV4jX+i1B0aYauIhVOEnJ8f4NrJLAapGemvHRtp9s8tA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4814 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-07_11,2022-11-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=758 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211080090 X-Proofpoint-ORIG-GUID: 51hbhkUIxQopUBHu9DQ0BbtF2PI2j1Ok X-Proofpoint-GUID: 51hbhkUIxQopUBHu9DQ0BbtF2PI2j1Ok X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Qing Zhao <qing.zhao@oracle.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748940135799577151?= X-GMAIL-MSGID: =?utf-8?q?1748940135799577151?= |
Series |
Add a new warning option -Wstrict-flex-array
|
|
Message
Qing Zhao
Nov. 8, 2022, 2:51 p.m. UTC
This patch serie include two changes: 1. Change the name of array_at_struct_end_p to array_ref_flexible_size_p. 2. Add a new warning option -Wstrict-flex-arrays and at the same time keep -Warray-bounds unchanged from -fstrict-flex-arrays. The new warning -Wstrict-flex-arrays is implemented at the same place as -Warray-bounds. Since we need to keep the old behaviors of -Warray-bounds=[1|2], we refactor the routine "array_bounds_checker::check_array_ref" to make it work for both -Warray-bounds and -Wstrict-flex-arrays. if -Warray-bounds, -Wstrict-flex-arrays, -fstrict-flex-arrays presents at the same time: A. -Warray-bounds will be not controlled by -fstrict-flex-arrays; B. -Wstrict-flex-arrays will be controled by -fstrict-flex-arrays; C. both -Warray-bounds and -Wstrict-flex-arrays will report warnings according to it's own rules. bootstrapped and regression tested on both x86 and aarch64. no issue. Okay for commit? thanks. Qing