From patchwork Sun Nov 5 10:02:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465955-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OqzP7Lec"; dkim-atps=neutral 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 3yVB8K2G8rz9t34 for ; Sun, 5 Nov 2017 21:02:54 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=xq0NgIs7iinBOJeZkRQbGHrpG0UjbOOOUBvKlmzvvs0ut5f7vJ VEoHFotmxRHO5HAJbkcbOadxFJVM06XQwFO2/HG/UgOqIPCHye3cKu9etpJYnHRy 6ZecfhXRHR/CYBb6Gw0OXaRgYNDO+4a20YxbR0hNyfY+Q2KP7V7edS7W8= 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:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=s+4WmdKzexmKZ6Q6om5wQ9TrYZY=; b=OqzP7LecqVRXbzxKz8Qa Djrq/HIOavQidgMZpdYEjL8SWc2w4eYVfSCmSeyw2pl9ilpT1UGKPnS+bQfUG+AT u9UR6gqt8ntRHgZgRVeHAWftAl8KydN/dLiF3P4BXVPSB1cK9ScjX5d4ta9XaM7u iy+CTytix7UwhT6iBPQ/4go= Received: (qmail 100373 invoked by alias); 5 Nov 2017 10:02:47 -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 100335 invoked by uid 89); 5 Nov 2017 10:02:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=beg, H*Ad:U*kcc, sk:sanitiz X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:02:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHlF-00000H-7Z from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:02:37 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:02:33 +0000 From: Tom de Vries Subject: [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body To: GCC Patches CC: Kostya Serebryany Message-ID: Date: Sun, 5 Nov 2017 11:02:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this removes a semicolon after "do {} while (0)" in several macro bodies in libsanitizer. This allows the macros to be used in if-then-elses without curly braces. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * asan/asan_poisoning.cc (CHECK_SMALL_REGION): Remove semicolon after "do {} while (0)". * lsan/lsan_common.cc (LOG_POINTERS, LOG_THREADS): Same. Signed-off-by: Tom de Vries --- libsanitizer/asan/asan_poisoning.cc | 2 +- libsanitizer/lsan/lsan_common.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsanitizer/asan/asan_poisoning.cc b/libsanitizer/asan/asan_poisoning.cc index 15cd8ea..1343dfb 100644 --- a/libsanitizer/asan/asan_poisoning.cc +++ b/libsanitizer/asan/asan_poisoning.cc @@ -215,7 +215,7 @@ uptr __asan_region_is_poisoned(uptr beg, uptr size) { uptr __bad = __asan_region_is_poisoned(__p, __size); \ __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);\ } \ - } while (false); \ + } while (false) extern "C" SANITIZER_INTERFACE_ATTRIBUTE diff --git a/libsanitizer/lsan/lsan_common.cc b/libsanitizer/lsan/lsan_common.cc index a3274d5..4afce9d 100644 --- a/libsanitizer/lsan/lsan_common.cc +++ b/libsanitizer/lsan/lsan_common.cc @@ -55,12 +55,12 @@ void RegisterLsanFlags(FlagParser *parser, Flags *f) { #define LOG_POINTERS(...) \ do { \ if (flags()->log_pointers) Report(__VA_ARGS__); \ - } while (0); + } while (0) #define LOG_THREADS(...) \ do { \ if (flags()->log_threads) Report(__VA_ARGS__); \ - } while (0); + } while (0) ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; static SuppressionContext *suppression_ctx = nullptr;